ushcompu

Desarrollo y Capacitación desde el Fin del Mundo

Archive for the ‘plugin’ tag

Plugin Vim para Pasto

one comment

Con el siguiente plugin para Vim se puede leer una entrada en Pasto, o enviar el archivo actual o la sección seleccionada del archivo actual.

arch vim logo

[Última edición por ushcompu el Octubre 4, 2009 a las 18:52 pm ART]
gracias niwi por la corrección de comillas

pasto.vim:

  1. " totoloco at gmail dot com
  2. " Licensed under sisterware
  3. " http://ushcompu.com.ar
  4. "needs curl in PATH
  5. "install on ~/.vim/plugin/ dir
  6. " based on:
  7. " paster.vim
  8. " http://www.vim.org/scripts/script.php?script_id=2602
  9. " pasto.sh
  10. " http://pasto.elefantesrosas.com.ar/pastos/view/48
  11.  
  12. if exists("g:loaded_Pasto") || !executable("curl") || &cp
  13. finish
  14. endif
  15.  
  16. let g:loaded_Pasto = '0.4'
  17. let s:pastoBase = 'http://pasto.elefantesrosas.com.ar'
  18.  
  19. let s:pastoSyntax = { 'awk': 'awk',
  20. \ 'sh': 'bash',
  21. \ 'c': 'c',
  22. \ 'cpp': 'cpp',
  23. \ 'html': 'html4strict',
  24. \ 'java': 'java',
  25. \ 'javascript': 'javascript',
  26. \ 'perl': 'perl',
  27. \ 'php': 'php',
  28. \ 'python': 'python',
  29. \ 'ruby': 'ruby',
  30. \ 'vim': 'vim',
  31. \
  32. \ 'default': 'text' }
  33.  
  34. function! s:ResolveTextFormat()
  35. return has_key(s:pastoSyntax, &filetype)
  36. \ ? s:pastoSyntax[&filetype]
  37. \ : s:pastoSyntax['default']
  38. endfunction
  39.  
  40. function! s:PastoPut(user, title, text)
  41. let params = 'data[_cli]=1&data[Pasto][nick]='.a:user
  42. let params .= '&data[Pasto][title]='.a:title
  43. let params .= '&data[Pasto][type]='.s:ResolveTextFormat()
  44. let url = s:pastoBase."/pastos/add"
  45. let command = 'curl -s --data-urlencode "data[Pasto][text]@-" -d "'.params.'" '.url
  46. echo 'Sending...'
  47. let output = split(system(command, a:text), '\n')
  48.  
  49. echom 'url: '.s:pastoBase.'/pastos/view/'.output[0]
  50. endfunction
  51.  
  52. function! Pasto() range
  53. let user = inputdialog('Enter nick / gravatar email: ', $USER)
  54. let title = inputdialog('Title: ', expand('%'))
  55. let text = join(getline(a:firstline, a:lastline), "\n")
  56. echo user
  57. call s:PastoPut(user, title, text)
  58. endfunction
  59.  
  60. function! PastoGet()
  61. let PastoId = inputdialog('Enter PastoId: ')
  62. let url = s:pastoBase.'/pastos/get/'.PastoId
  63. let command = 'curl -s '.url
  64. echo 'Loading...'
  65. execute '.!'.command
  66. echo 'Loaded!'
  67. endfunction
  68.  
  69. com! PastoGet :call PastoGet()
  70. com! -range=% -nargs=0 Pasto :<line1>,<line2>call Pasto()

Written by ushcompu

octubre 4th, 2009 at 12:50 pm

Posted in *nix,Web

Tagged with , ,

Atpic plugin

2 comments

En el pie de página se pueden ver una galería de imágenes cuyo origen son atpic.com

ushcompu desarrolló un plugin para wordpress + atpic, basado en jquery + simplegallery.

Enlaces de interés:
atpic.com
jquery.com
simplegallery

EDITADO:

Descargar el plugin en:

http://wordpress.org/extend/plugins/atpic/

Written by ushcompu

junio 29th, 2009 at 7:48 pm

Posted in Css,Web,javascript,php

Tagged with , , ,