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 (c) 2007, Tony Ivanov | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. | |
* Redistributions in binary form must reproduce the above copyright | |
notice, this list of conditions and the following disclaimer in the | |
documentation and/or other materials provided with the distribution. |
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
# ====== TODAY'S KATA: | |
# * create an Achievements API | |
# * create an Achievement model, a User model, and a db table for many-many relationship between the two | |
# * now, write the Goliath+Grape code to create 3 endpoints: | |
# * 1. an endpoint to SHOW an Achievement (GET /v1/achievements/1) | |
# * 2. an endpoint to SHOW a User (GET /v1/users/1) | |
# * 3. an endpoint to GRANT an Achievement to a user (???) | |
# EXAMPLE GEMFILE THAT SHOULD WORK: |
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
#you can copy this into IRB or just run it as a file | |
require "net/http" | |
require "uri" | |
# require "net/https" # for testing ssl | |
url = "http://localhost:3000/login" | |
yaml = %{ --- !ruby/object:Time {} } | |
xml = %{<?xml version="1.0" encoding="UTF-8"?><foo type="yaml">#{yaml}</foo>}.strip |
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 gems with versions | |
begin | |
require 'logger' | |
require 'rubygems' | |
gem 'fog', '~> 0.6.0' | |
gem 'trollop', '~> 1.16.2' | |
require 'fog'; require 'trollop' |
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 | |
config_input() { | |
setxkbmap -option ctrl:nocaps | |
dev="TPPS/2 IBM TrackPoint" | |
xinput --set-prop "$dev" "Evdev Wheel Emulation" 1 | |
xinput --set-prop "$dev" "Evdev Wheel Emulation Button" 2 | |
xinput --set-int-prop "$dev" "Evdev Wheel Emulation Axes" 8 6 7 4 5 | |
} |
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 | |
config_input() { | |
setxkbmap -option ctrl:nocaps | |
dev="TPPS/2 IBM TrackPoint" | |
xinput --set-prop "$dev" "Evdev Wheel Emulation" 1 | |
xinput --set-prop "$dev" "Evdev Wheel Emulation Button" 2 | |
xinput --set-int-prop "$dev" "Evdev Wheel Emulation Axes" 8 6 7 4 5 | |
} |
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('awful') | |
require('awful.autofocus') | |
require('awful.rules') | |
require('beautiful') | |
require('naughty') | |
require('obvious.battery') | |
require('debian.menu') | |
beautiful.init('.config/awesome/themes/custom/theme.lua') |
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
###################### | |
# proxy_up.sh.erb | |
#!/bin/bash | |
echo 'Starting emproxy...' | |
sudo monit start all -g emproxy_ngin | |
echo 'Sleeping for 5s before reloading haproxy...' | |
sleep 5 | |
echo 'Reloading haproxy...' | |
/data/ngin/shared/bin/haproxy_remove |
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
db = rds.create_db_instance( | |
:db_instance_identifier => "[FILTERED]", | |
:allocated_storage => 100, | |
:db_instance_class => "db.m1.small", | |
:engine => "MySQL5.1", | |
:master_username => '[FILTERED]', | |
:master_user_password => '[FILTERED]', | |
:db_name => '[FILTERED]', | |
:availability_zone => 'us-east-1c' | |
) |
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
~/$ lein new ring-on-heroku | |
Created new project in: /home/jim/Development/ring-on-heroku | |
~/$ cd ring-on-heroku | |
~/ring-on-heroku$ echo 'web: lein run -m ring-on-heroku.core' > Procfile | |
~/ring-on-heroku$ cat > src/ring_on_heroku/core.clj | |
(ns ring-on-heroku.core | |
(:use ring.util.response | |
ring.adapter.jetty)) | |
(defn app [req] |