This file contains 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
CmdUtils.CreateCommand({ | |
name: "gist-credentials", | |
//takes: {"login_name": noun_arb_text}, | |
modifiers: {"login_name": noun_arb_text, "tok": noun_arb_text}, | |
homepage: "http://www.sample.me.uk/ubiquity/", | |
author: { name: "Duncan Sample" }, | |
description: "Sets the login credentials for github", | |
help: "service should be either 'delicious' or 'magnolia'", | |
license: "MPL", | |
preview: function( pblock ) { |
This file contains 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
/* This is a template command */ | |
CmdUtils.CreateCommand({ | |
name: "publicprbb", | |
icon: "http://example.com/example.png", | |
homepage: "http://example.com/", | |
author: { name: "Your Name", email: "you@example.com"}, | |
license: "GPL", | |
description: "Em mostra les reserves de sales", | |
help: "how to use your command", | |
takes: {"input": noun_arb_text}, |
This file contains 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
//Searches Catalan words at Enciclopedia Catalana dictionary page | |
CmdUtils.makeSearchCommand({ | |
name: "diccionari-català", | |
url: "http://ec.grec.net/cgi-bin/AppDLC3.exe?APP=CERCADLC&GECART={QUERY}" | |
}); | |
This file contains 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
function myText(textFormat) { | |
// get the active document in a secure way | |
var doc = CmdUtils.getDocument(); | |
var commenters = ""; | |
jQuery(doc.body).find('.comment-block h4 a').each( | |
function(i){ | |
if(!/img/i.test(this.innerHTML)){ | |
commenters += '@<b>' + this.innerHTML + '</b>: gràcies - gracias - thanks.'; | |
if(textFormat) { |
This file contains 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/ruby | |
#Backup directory to DVD | |
require 'fileutils' | |
if !ARGV[1] | |
puts "Usage: backupdvd.rb <Directory to backup> <disk no>" | |
exit | |
end |
This file contains 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
# rubysrvc.rb | |
require 'rubygems' | |
require 'win32/service' | |
require 'win32/daemon' | |
include Win32 | |
SERVICE_NAME = "RubySvc" | |
SERVICE_DISPLAYNAME = "A Ruby Service" |
This file contains 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
# | |
# sample program of expect.rb | |
# | |
# by A. Ito # | |
# This program reports the latest version of ruby interpreter | |
# by connecting to ftp server at netlab.co.jp. | |
# | |
require 'pty' | |
require 'expect' |
This file contains 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
# | |
# sample program of expect.rb | |
# | |
# by A. Ito # | |
# This program reports the latest version of ruby interpreter | |
# by connecting to ftp server at netlab.co.jp. | |
# | |
require 'pty' | |
require 'expect' |
This file contains 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
cat ~/.ssh/id_rsa.pub | ssh administrador@192.168.150.19 'mkdir ~/.ssh;chmod 700 ~/.ssh;touch ~/.ssh/authorized_keys2;chmod 600 ~/.ssh/authorized_keys2;cat - >> .ssh/authorized_keys2 ' |
This file contains 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
def random_password(size = 8) | |
chars = (('A'..'Z').to_a + ('a'..'z').to_a + ('0'..'9').to_a) - %w(i o 0 1 l 0) | |
(1..size).collect{|a| chars[rand(chars.size)] }.join | |
end | |
puts random_password.inspect |
OlderNewer