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 | |
PREFIX=$1 | |
COUNT=$2 | |
PASS=$3 | |
# validation | |
if [ $# -ne 3 ]; then | |
echo "Usage: $0 <prefix> <count> <password>" | |
exit |
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
// | |
// Example usage: phantomjs screenshot.js http://yahoo.com /tmp/yahoo.png | |
// | |
var system = require('system'); | |
var url = system.args[1]; | |
var filename = system.args[2]; | |
var page = new WebPage(); | |
page.open(url, function (status) { |
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 | |
# Formats a man page for reading in a browser, and opens it. Example: | |
# | |
# hman xsltproc | |
# | |
stylesheet=$(cat <<eocss | |
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:output method="html" encoding="UTF-8" indent="yes"/> |
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
class PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
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
From 6f174a93fdda24b0913f65734d0b36849910e3dc Mon Sep 17 00:00:00 2001 | |
From: Igor Anic <[email protected]> | |
Date: Wed, 25 May 2011 12:39:39 +0200 | |
Subject: [PATCH] initial commit of databse mirroring funcionality to the new repo | |
--- | |
.gitignore | 3 +- | |
MIRRORING_HOW_TO | 48 +++++++ | |
Rakefile | 14 ++- | |
.../connection_adapters/sqlserver/mirroring.rb | 85 +++++++++++++ |
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
# Copyright 2011 Sam Elliott | |
# Released under MIT Licence | |
app_name = File.basename(Dir.pwd) | |
git :init | |
# Remove rails.png and index.html | |
remove_file("public/index.html") | |
remove_file("public/images/rails.png") | |
create_file("public/images/.gitkeep") |
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 ruby | |
require 'rubygems' | |
gems = Gem.source_index.search(Gem::Dependency.new(//, Gem::Requirement.default)) | |
gems.each do |gem| | |
puts "gem '#{gem.name}', '#{gem.version.to_s}'" | |
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
# Main sinatra app | |
require 'sinatra' | |
require 'activerecord' | |
require 'activesupport' | |
include ActionView::Helpers::DateHelper # add the required helpers here. | |
require 'controllers.rb' | |
# controllers.rb |
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
def belongs_to(association_id, options = {}) | |
association_column = options[:foreign_key] ||= association_id.to_s + "_id" # | |
reflection = create_belongs_to_reflection(association_id, options) | |
if reflection.options[:polymorphic] | |
association_accessor_methods(reflection, BelongsToPolymorphicAssociation) | |
else | |
association_accessor_methods(reflection, BelongsToAssociation) | |
association_constructor_method(:build, reflection, BelongsToAssociation) | |
association_constructor_method(:create, reflection, BelongsToAssociation) |
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
njero - http://neverlet.be | |
sutto - http://blog.ninjahideout.com | |
zapnap - http://blog.zerosum.org | |
tpope - http://tpope.net | |
reinh - http://reinh.com | |
bryanl - http://smartic.us | |
linoj - http://www.vaporbase.com | |
technicalpickles - http://technicalpickles.com | |
MaD15 - enlightsolutions.com/ | |
qrush - http://litanyagainstfear.com/ |
NewerOlder