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 file extends the Kernel's require function and adds the | |
# AutoReload module which allows to reload files once they have changed | |
# on the disk. | |
# | |
# Basically, you just require your files as usual, and if you want to update | |
# the files, either call AutoReload.reload(file) or AutoReload.reload_all. | |
# | |
# Usage: | |
# irb -rautoload | |
# |
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
require 'rubygems' | |
require 'sqlite3' | |
require 'rexml/document' | |
include REXML | |
xml =<<XML | |
<records> | |
<entry><name>abc</name><qty>3</qty></entry> | |
<entry><name>def</name><qty>5</qty></entry> | |
<entry><name>ghi</name><qty>2</qty></entry> |
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
jQuery("body").find('img').each(function(i,img) { | |
var w = img.width; | |
var h = img.height; | |
if (w && h) { | |
var src = 'http://placekitten.com/'+w+'/'+h; | |
img.src = src; | |
} | |
}); | |
// code from https://github.com/lsemel/jquery-placekitten |
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 -w | |
require 'csv' | |
require 'active_support/core_ext' | |
class Parser | |
attr_accessor :input_folder | |
attr_accessor :output_folder | |
attr_accessor :filename |
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
#!/bin/sh -e | |
#git-cache-meta -- simple file meta data caching and applying. | |
#Simpler than etckeeper, metastore, setgitperms, etc. | |
#from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694 | |
#modified by n1k | |
# - save all files metadata not only from other users | |
# - save numeric uid and gid | |
# 2012-03-05 - added filetime, andris9 |
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
BUY WARFAMA 20120327 1.52 18.57923 2595257 lastprice=1.67 targetprice=1.35 quantity>=569.80 | |
BUY TRAKCJA 20120323 1.21 18.40000 7787679 lastprice=1.16 targetprice=.94 quantity>=818.32 | |
BUY DSS 20120322 4.62 18.39286 1250754 lastprice=3.70 targetprice=3.01 quantity>=255.55 | |
BUY ABMSOLID 20120330 3.20 18.36735 3341862 lastprice=3.14 targetprice=2.56 quantity>=300.48 | |
BUY BIOTON 20120329 0.10 18.18182 1713404 lastprice=0.09 targetprice=.07 quantity>=10989.00 | |
BUY CIECH 20120320 16.45 12.26667 6342807 lastprice=16.65 targetprice=14.60 quantity>=52.68 | |
BUY SKOTAN 20120319 3.03 11.38462 5863662 lastprice=3.57 targetprice=3.16 quantity>=243.42 | |
BUY OVOSTAR 20120328 111.90 10 1003295 lastprice=109.20 targetprice=98.28 quantity>=7.82 | |
BUY MIDAS 20120321 0.90 8.33333 11032438 last |
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
+----------------+---------------+---------------+---------------+ | |
| Performance of Scottrade_50209607, 2012-04-02T00:24:33+02:00 | | |
+----------------+---------------+---------------+---------------+ | |
|group |Unrealized |Realized |Combined | | |
+----------------+---------------+---------------+---------------+ | |
| openValueSum | 2347.31 | 3056.22 | 1865.23 | | |
| closeValueSum | 2365.24 | 3132.37 | 1883.16 | | |
| gainLossRaw | 17.93 | 76.15 | 94.08 | | |
| profitSum | 17.93 | 76.15 | 94.08 | | |
| gainLossPerc | 0.76 | 2.49 | 5.04 | |
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
var system = require('system'); | |
if (system.args.length < 5) { | |
console.info("You need to pass in account name, username, password, and path to casperJS as arguments to this code."); | |
phantom.exit(); | |
} | |
var account = system.args[1]; | |
var username = system.args[2]; | |
var password = system.args[3]; |
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/env sh | |
# Download lists, unpack and filter, write to stdout | |
curl -s https://www.iblocklist.com/lists.php \ | |
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \ | |
| xargs wget -O - \ | |
| gunzip \ | |
| egrep -v '^#' |
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
module Psych | |
module Visitors | |
class ToRuby < Psych::Visitors::Visitor | |
def deserialize o | |
if klass = Psych.load_tags[o.tag] | |
instance = klass.allocate | |
if instance.respond_to?(:init_with) | |
coder = Psych::Coder.new(o.tag) | |
coder.scalar = o.value |
OlderNewer