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
| # TODO: finish this | |
| class Colors | |
| attr_accessor :color | |
| ColorAttr = Struct.new(:name, :hex) | |
| { | |
| :silver => ColorAttr.new("silver", "ff0000"), | |
| :blue => ColorAttr.new("blue", "ff0000"), | |
| :black => ColorAttr.new("black", "ff0000"), | |
| :white => ColorAttr.new("white", "ff0000"), | |
| :red => ColorAttr.new("red", "ff0000"), |
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/sh | |
| # script name: mkmailuser | |
| # part of freebsd helpers | |
| # author todor dragnev aka t0d0r | |
| ## get command line | |
| user1=$1 | |
| password=$2 | |
| ip=$3 | |
| email=$4 |
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 | |
| # | |
| # Derived from - | |
| # Joshua Davis | |
| # http://shrubbery.mynetgear.net/c/display/W/Java+Daemon+Startup+Script | |
| # | |
| # This is a modification of the original script (which lets you run a java program as a deamon. | |
| # look bellow for more information) that lets you run a groovy script as a deamon. | |
| # | |
| # ============== OLD SCRIPT TEXT ============== |
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
| // ==UserScript== | |
| // @name remote.bank.allianz.bg | |
| // @author Todor Dragnev aka t0d0r http://twitter.com/t0d0r | |
| // @namespace allianz.usersript.org.bstconsult.com | |
| // @description fix forms in web interface, just click on left or right side on the page to increase/decrease input widht | |
| // @include https://remote.bank.allianz.bg/* | |
| // @require https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js | |
| // ==/UserScript== | |
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
| at = s.attributes | |
| at["approxtime"] = Time.now # must have value | |
| ["id", "created_at", "updated_at"].each { |e| at.delete(e) } | |
| fm = ForthManeuver.create( at ) |
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
| # rails hgignore | |
| syntax: glob | |
| *~ | |
| .bundle | |
| .*swp | |
| db/*.sqlite3 | |
| doc/app/* | |
| log/*.log | |
| tmp/**/* | |
| .git |
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
| # custom generators in rails | |
| # for example using haml instead of pure html in r g scaffold | |
| git clone git://github.com/pjb3/rails3-generators.git lib/generators | |
| # config/application.rb | |
| config.generators do |g| | |
| g.template_engine :haml | |
| g.test_framework :rspec, :fixture => true, :views => false | |
| g.fixture_replacement :factory_girl, :dir => "spec/factories" | |
| end |
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
| # using VestalVersions | |
| # gem 'vestal_versions', :git => 'git://github.com/adamcooper/vestal_versions' # don't work with rails 3.1 | |
| gem 'vestal_versions', :git => 'git://github.com/jodosha/vestal_versions' # this work with 3.1 | |
| VestalVersions::Version.where(:versioned_type => "Place") |
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
| snippet rip | |
| .rest-in-place{'data-attribute' => '${1}'} |
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
| require 'open-uri' | |
| require 'nokogiri' | |
| require 'erb' | |
| include ERB::Util | |
| q=url_encode("site:shipspotting.com 7811032 IMO") | |
| doc = Nokogiri::HTML(open("http://www.google.com/search?q=#{q}")) | |
| link = doc.css("h3.r > a").first |