This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| table .blue { | |
| color: #049cdb; | |
| border-bottom-color: #049cdb; | |
| } | |
| table .green { | |
| color: #46a546; | |
| border-bottom-color: #46a546; | |
| } | |
| table .red { | |
| color: #9d261d; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| URL_LIST=$* | |
| YOUTUBE_DL="/usr/local/bin/youtube-dl" | |
| YOUTUBE_DL_OPTS="--title --restrict-filenames --write-thumbnail --extract-audio --audio-format mp3 --audio-quality 0 --continue --no-overwrites" | |
| ${YOUTUBE_DL} ${YOUTUBE_DL_OPTS} ${URL_LIST} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # A Shell Script To Convert All .flac Files To .MP3 Format | |
| # Note: I found this script somewhere on usenet and I've modified it for my needs | |
| METAFLAC=/usr/local/bin/metaflac | |
| FLAC=/usr/local/bin/flac | |
| #ID3=/usr/bin/id3 | |
| LAME=/usr/local/bin/lame | |
| FIND=/usr/bin/find | |
| t=$(${FIND} . -type f -iname "*.flac") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env node | |
| function primeNumbers(n) { | |
| arr = []; | |
| for (var i = 2; arr.length < n; i++) { | |
| var is_div = false; | |
| for (var count = 2; count < i; count++) { | |
| if (i % count === 0) { | |
| is_div = true; | |
| break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| project :test => :rspec, :orm => :activerecord, :adapter => :postgres, :mock => :none, :script => :jquery, :renderer => :erb, :stylesheet => :none, :admin_renderer => :erb | |
| # include additional generators | |
| inject_into_file destination_root('config/boot.rb'), "\# include additional generators\nPadrino::Generators.load_paths << Padrino.root('generators', 'kyan_admin_page_generator.rb')\nPadrino::Generators.load_paths << Padrino.root('generators', 'kyan_admin_generator.rb')\n\n", :before => "Padrino.load!" | |
| say "Cloning custom generators from [email protected]:xavierRiley/Kyan-Padrino-Admin-Generators.git", :red | |
| remove_dir destination_root('generators') | |
| run "git clone [email protected]:xavierRiley/Kyan-Padrino-Admin-Generators.git " + destination_root('generators') | |
| #generate :model, "account username:string password:string" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if params[:_search] == "true" && params[:filters].present? | |
| filters = Hash.new | |
| j = JSON.parse(params[:filters]) | |
| i=0 | |
| until j.fetch("rules").size == i | |
| k = j.fetch("rules").to_a[i].values_at("field", "op", "data", "groupOp") | |
| if k[1] == "cn" | |
| k[1] = "matches" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Selector de idioma | |
| #dependencias: | |
| # 1 - Rack locale del paquete Rack-contrib [1] | |
| # USO: Se usa para detectar el idioma definido por el usuario en su browser ['HTTP_ACCEPT_LANGUAGE'] | |
| # Esplicado aquí http://guides.rubyonrails.org/i18n.html#using-accept-language | |
| # [1] http://github.com/rack/rack-contrib | |
| # 2 - Routing-filter [1] | |
| # USO: Establecer el locale en las URLs ej.: www.mysite.com/es/foo/bar | |
| # NOTA: Si tambien quieres traducir las URL's usa la gema de Raul Murciano Translate_routes [2] (De momento sin cobertura para Rails3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module CouchDBAttachments | |
| def attachment(*args) | |
| lambda do |env| | |
| request = ActionDispatch::Request.new(env) | |
| doc = DocWithAttachments.get(request.params[:doc]) | |
| serve_attachment(doc, request.params[:path]) | |
| end | |
| end | |
| private |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module CouchDBAttachments | |
| def attachment(*args) | |
| lambda do |env| | |
| request = ActionDispatch::Request.new(env) | |
| doc = DocWithAttachments.get(request.params[:doc]) | |
| serve_attachment(doc, request.params[:path]) | |
| end | |
| end | |
| private |