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
class Object | |
def symbolize(target = nil) | |
target = self.clone if target == nil | |
if target.class == Hash | |
clone = target.clone | |
clone.each_pair do |key, value| | |
target[key] = value.symbolize! if [Array, Hash].include? value.class |
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
# -*- encoding: utf-8 -*- | |
from sys import argv | |
from enchant import request_dict | |
if len(argv) <= 1: | |
print "USAGE: python basic_testing.py <sentence>" | |
exit() | |
else: |
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
#include <iostream> | |
using namespace std; | |
class Rectangle { | |
int width, height; | |
public: | |
Rectangle(int x, int y) : width(x), height(y) {} | |
int area(void) { return width * height; } | |
}; |
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
set nocompatible " be iMproved, required | |
" Load vim-plug | |
if empty(glob("~/.vim/autoload/plug.vim")) | |
execute '!curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.github.com/junegunn/vim-plug/master/plug.vim' | |
endif | |
call plug#begin('~/.vim/plugged') | |
" Dependencies |
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
rotate :: Int -> [Char] -> [Char] | |
rotate k list | k >= 0, k <= length list = drop k list ++ take k list | |
| otherwise = [] | |
makeKey :: Int -> [(Char,Char)] | |
makeKey n = zip xs ys | |
where | |
xs = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" -- You can use ['A'..'Z'] | |
ys = rotate n xs |
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
source 'https://rubygems.org' | |
gem 'sinatra' | |
gem 'twilio-ruby' | |
gem 'thin' |
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
from flask import Flask, request, Response | |
from twilio.rest import TwilioRestClient | |
from twilio import twiml | |
app = Flask(__name__) | |
account = 'Insert SID here' | |
token = 'Auth token' | |
client = TwilioRestClient(account, token) |
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
Running virtualenv with interpreter /usr/local/bin/python3 | |
Using base prefix '/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4' | |
New python executable in venv/bin/python3.4 | |
Also creating executable in venv/bin/python | |
Failed to import the site module | |
Traceback (most recent call last): | |
File "/Users/williammathewson/Programming/Python/possel/venv/bin/../lib/python3.4/site.py", line 67, in <module> | |
import os | |
File "/Users/williammathewson/Programming/Python/possel/venv/bin/../lib/python3.4/os.py", line 616, in <module> | |
from _collections_abc import MutableMapping |
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
~ ⌚ 19:34:44 | |
$ ifconfig eth0 | |
eth0 Link encap:Ethernet HWaddr da:1f:52:45:d4:81 | |
inet addr:185.17.149.144 Bcast:185.17.149.191 Mask:255.255.255.192 | |
inet6 addr: 2001:1b40:3601:8:d81f:52ff:fe45:d481/64 Scope:Global | |
inet6 addr: 2001:1b40:3601:8:512c:8ac1:80b3:a738/64 Scope:Global | |
inet6 addr: fe80::d81f:52ff:fe45:d481/64 Scope:Link | |
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 | |
RX packets:109702 errors:0 dropped:0 overruns:0 frame:0 | |
TX packets:75583 errors:0 dropped:0 overruns:0 carrier: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
public class Mode { | |
public static void main(String[] args) { | |
int[] dataset = new int[args.length]; | |
int[] count = new int[10]; | |
int mode; | |
for (int i = 0; i < args.length; i++) { | |
dataset[i] = Integer.parseInt(args[i]); | |
} |
OlderNewer