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
<?php | |
/* | |
Plugin Name: Include Custom Files | |
Plugin URI: http://wpprogrammer.com/include-custom-files/ | |
Description: Allows you to include multiple stylesheets and javascript files on a per-post basis. | |
Version: 1.0 | |
Author: Utkarsh Kukreti | |
Author URI: http://utkar.sh | |
== Release Notes == |
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
apt-get install htop binutils cpp flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl m4 libpcre3 libpcre3-dev libssl-dev libpopt-dev lynx make perl perl-modules openssl unzip zip autoconf2.13 gnu-standards automake libtool bison build-essential zlib1g-dev ntp ntpdate autotools-dev g++ bc subversion psmisc libmysqlclient-dev libcurl4-openssl-dev libjpeg62-dev libpng3-dev libxpm-dev libfreetype6-dev libt1-dev libmcrypt-dev libxslt1-dev libbz2-dev libxml2-dev libevent-dev libltdl-dev libmagickwand-dev imagemagick git-core | |
# server | |
apt-get install nginx | |
# mysql | |
apt-get install mysql-server | |
# php | |
cd /usr/src |
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 setup() | |
Mongoid.configure do |config| | |
config.master = Mongo::Connection.new.db("testbooks") | |
end | |
@book = Books.create(title: 'Turn of a Screw', author: "Henry James", barcode: '666') | |
end | |
def test_barcode | |
# Test for uniqueness of each book barcode |
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
[od]$ rails c | |
Loading development environment (Rails 3.0.6) | |
ruby-1.9.2-p180 :001 > Deparment.all | |
=> #<Mongoid::Criteria | |
selector: {}, | |
options: {}, | |
class: Deparment, | |
embedded: false> | |
ruby-1.9.2-p180 :002 > Deparment.all.entries |
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
# Save as Rakefile, and run `rake watch` | |
def recompile(base, relative) | |
haml = File.join(base, relative) | |
html = File.join(base, relative.gsub(/\.haml$/, '.html')) | |
print ">>> Change detected to #{relative} >> " | |
system "haml", haml, html | |
puts "Compiled <<<" | |
end | |
desc "Watch HAML files for changes" |
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 python | |
# vim: set fileencoding=utf-8 | |
# (c) Uwe Kleine-König <[email protected]> | |
# GPLv2 | |
# Modified by Utkarsh Kukreti <[email protected]> - 2011/05/31 | |
import locale | |
import sys | |
f = file(sys.argv[1]) |
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
pry(Ripper)> sexp %q{"foo\nbar"} | |
=> [:program, [[:string_literal, [:string_content, [:@tstring_content, "foo\\nbar", [1, 1]]]]]] | |
pry(Ripper)> sexp %q{'foo\nbar'} | |
=> [:program, [[:string_literal, [:string_content, [:@tstring_content, "foo\\nbar", [1, 1]]]]]] | |
pry(Ripper)> sexp %q{'foo\nbar'} | |
=> [:program, [[:string_literal, [:string_content, [:@tstring_content, "foo\\nbar", [1, 1]]]]]] | |
pry(Ripper)> sexp %q{'foo\\nbar'} | |
=> [:program, [[:string_literal, [:string_content, [:@tstring_content, "foo\\nbar", [1, 1]]]]]] | |
pry(Ripper)> sexp %q{"foo\\nbar"} | |
=> [:program, [[:string_literal, [:string_content, [:@tstring_content, "foo\\nbar", [1, 1]]]]]] |
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
pry(main)> module Blah | |
pry(main)* def blah | |
pry(main)* true | |
pry(main)* end | |
pry(main)* end | |
=> nil | |
pry(main)> a = [] | |
=> [] | |
pry(main)> Enumerable.send(:include, Blah) | |
=> Enumerable |
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 'httparty' | |
class HTTP | |
include HTTParty | |
def initialize uri | |
self.class.base_uri uri | |
end | |
end | |
class Dropbox < HTTP |
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
ruby-1.9.2-p180:001:0>> qb(10**6) { Math.log10(123456789).floor + 1 } | |
Rehearsal ------------------------------------ | |
1.120000 0.000000 1.120000 ( 1.100062) | |
--------------------------- total: 1.120000sec | |
user system total real | |
1.090000 0.000000 1.090000 ( 1.085366) | |
# => nil | |
ruby-1.9.2-p180:002:0>> qb(10**6) { 123456789.to_s.size } | |
Rehearsal ------------------------------------ |
OlderNewer