An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
CREATE TABLE `user` ( | |
`twitter_id` int(10) unsigned NOT NULL, | |
`created_at` timestamp NOT NULL default '0000-00-00 00:00:00', | |
`name` varchar(80) NOT NULL, | |
`screen_name` varchar(30) NOT NULL, | |
`location` varchar(120) default NULL, | |
`description` varchar(640) default NULL, | |
`profile_image_url` varchar(400) NOT NULL, | |
`url` varchar(100) default NULL, |
CREATE TABLE `user` ( | |
`twitter_id` int(10) unsigned NOT NULL, | |
`name` varchar(140) NOT NULL, | |
`screen_name` varchar(30) NOT NULL, | |
`location` varchar(180) default NULL, | |
`description` varchar(300) default NULL, | |
`profile_image_url` varchar(400) NOT NULL, | |
`url` varchar(400) default NULL, | |
`protected` varchar(5) default NULL, | |
`followers_count` int(10) unsigned NOT NULL, |
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
import sublime, sublime_plugin | |
import os | |
class DetectFileTypeCommand(sublime_plugin.EventListener): | |
""" Detects current file type if the file's extension isn't conclusive """ | |
""" Modified for Ruby on Rails and Sublime Text 2 """ | |
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
def on_load(self, view): | |
filename = view.file_name() |
# uber-hacky dynamic collection names for MongoID models: | |
# | |
# class MyModel | |
# include Mongoid::PrefixableDocument # ...instead of Mongoid::Document | |
# include Mongoid::Timestamps | |
# | |
# field :foobar, :type => Integer | |
# | |
# def my_method; 123; end | |
# |
File: lib/tasks/bar.rake | |
class BarOutput | |
def self.banner text | |
puts '*' * 60 | |
puts " #{text}" | |
puts '*' * 60 | |
end | |
def self.puts string | |
puts string |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
#!/bin/sh | |
# Converts git log to a ChangeLog file. | |
git log --pretty=format:"%ai %aN %n%n%x09* %s%d%n" > ChangeLog |
#!/bin/bash | |
############################################### | |
# To use: | |
# https://raw.github.com/gist/2776351/??? | |
# chmod 777 install_postgresql.sh | |
# ./install_postgresql.sh | |
############################################### | |
echo "*****************************************" | |
echo " Installing PostgreSQL" | |
echo "*****************************************" |