Externally reference ECMAScript in an SVG file
<script type="text/ecmascript" xlink:href="scripts/changeCircle.js"/>
11332 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
<script type="text/ecmascript" xlink:href="scripts/changeCircle.js"/>
$wgRC2UDPAddress = '69.178.6.244'; $wgRC2UDPPort = '41895'; $wgRC2UDPPrefix = "";
require 'rubygems' require 'tinder' require 'socket' puts 'Dependencies loaded...' campfire = Tinder::Campfire.new 'subdomain' campfire.login 'email@domain.com', 'password' exit unless room = campfire.find_room_by_name('Case Sensitive Room Name') puts 'Campfire logged in...' server = UDPSocket.new exit unless server.bind('0.0.0.0', 41895) puts 'Socket listening...' loop do msg = server.recv(2048).gsub(/\003[\d]{0,2}/,'').chomp print "sending to room: #{msg.inspect}..." exit unless room.speak msg.to_s puts ' sent!' end
#!/usr/bin/env ruby if ARGV.size > 1 then gem 'activesupport' require 'active_support/core_ext/string/inflections' class String include ActiveSupport::CoreExtensions::String::Inflections end command = ARGV.shift ARGV.each { |argument| puts argument.send( command ) } else # Print usage information puts "Usage: #{File.basename( __FILE__ )} <command> <argument_1> [<argument_2> ...]" end
function hace($timestamp) { $diferencia = time() - $timestamp; if($diferencia > 0) { $periodo = array("segundo", "minuto", "hora", "dia", "semana", "mes" , "año", "decada"); $longitud = array( "60" , "60" , "24" , "7" , "4.35", "12" , "10" ); for($j = 0; $diferencia >= $longitud[$j]; $j++) $diferencia /= $longitud[$j]; $diferencia = round($diferencia); if($diferencia != 1) { if($periodo[$j] == "mes") $periodo[$j].= "es"; else $periodo[$j].= "s"; } return "Hace <b>".$diferencia."</b> ".$periodo[$j]; } }
#!/bin/bash for i in `seq 1 329` do wget http://xkcd.com/$i/ wget `grep http://imgs.xkcd.com/comics/ index.html | head -1 | cut -d\" -f2` rm index.html done
#!/bin/bash for file in *.flac do echo Converting $file flac123 -q --wav=- "$file" | lame - "$file".mp3 done
script-name: does [system/options/script]
#!/bin/sh svn remove log/* svn commit -m"removing log files" svn propset svn:ignore "*.log" log/ svn update log/ svn commit -m 'Ignoring all files in /log/ ending in .log' svn move config/database.yml config/database.example svn commit -m 'Moving database.yml to database.example to provide a template for anyone who checks out the code' svn propset svn:ignore "database.yml" config/ svn update config/ svn commit -m 'Ignoring database.yml' svn remove tmp/* svn propset svn:ignore "*" tmp/ svn update tmp/ svn commit -m "ignore tmp/ content from now" svn propset svn:ignore ".htaccess" config/ svn update config/ svn commit -m 'Ignoring .htaccess' svn propset svn:ignore "dispatch.fcgi" config/ svn update config/ svn commit -m 'Ignoring dispatch.fcgi'
#!/bin/sh killall ruby mongrel_rails start -d sleep 1 open http://localhost:3000/ sleep 1 mate .
ls --color=never