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/bash | |
DEST=$1 | |
FILE=${DEST%/}$RANDOM | |
mv $1 $FILE | |
mv $2 $1 | |
mv $FILE $2 | |
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 | |
nohup $HOME/bin/Sublime\ Text\ 2/sublime_text -n $* > /dev/null 2>&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
# CRASH | |
# +HACKER | |
# ------- | |
# REBOOT | |
# | |
for vector in (0..9).to_a.permutation | |
a,b,c,e,h,k,o,r,s,t = vector | |
next if c == 0 or h == 0 or r == 0 |
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 "sinatra" | |
require "rest-graph" | |
enable :sessions | |
# set :raise_errors, false | |
# set :show_exceptions, false | |
FACEBOOK_SCOPE = 'read_stream' | |
unless ENV["FACEBOOK_APP_ID"] && ENV["FACEBOOK_SECRET"] |
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
3/1 | |
HTML, CSS, Layout | |
3/8 | |
HTML, CSS, Layout | |
Project teams | |
HW1: CSS | |
DUE 3/20 |
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
m = Mutex.new | |
i = [0] | |
a = Fiber.new do | |
t = nil | |
m.synchronize { t = i[0] } | |
Fiber.yield | |
m.synchronize { i[0] = t + 1 } | |
end | |
b = Fiber.new do | |
t = nil |
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
gem install bundler | |
gem install rails | |
rails new blog | |
cd blog | |
bundle install |
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
# Gemfile | |
source 'https://rubygems.org' | |
gem 'rails', '3.2.3' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'rest-graph' | |
gem 'rest-client' | |
gem 'json' |
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 | |
from gmusicapi.api import Api | |
from getpass import getpass | |
class Tagging: | |
def __init__(self): | |
self.api = Api() | |
logged_in = False |
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
<html> | |
<head> | |
<title>HashGreen</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var conn, msg = $("#msg"), log = $("#log"); | |
$("#form").submit(function() { | |
if (!conn) return false; |
OlderNewer