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
| var AnswerClass = React.createClass({ | |
| handleChange: function (e) { | |
| e.preventDefault(); | |
| var answer = React.findDOMNode(this.refs.answer).value.trim(); | |
| // this.props has an attr of onAnswerChange, however its value is undefined here, | |
| // causing a Uncaught TypeError: undefined is not a function | |
| this.props.onAnswerChange(answer); | |
| }, | |
| render: function () { | |
| return ( |
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
| import os | |
| import subprocess | |
| FILES = os.listdir('.') # ~/path/to/vids | |
| TEMPLATE_PREFIX = 'file ' | |
| OUTPUT_LIST = [] | |
| for file_name in sorted(FILES): | |
| full_file_path = os.path.abspath(file_name) | |
| OUTPUT_LIST.append(TEMPLATE_PREFIX + full_file_path) |
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 python | |
| import os | |
| import shutil | |
| HOME = os.path.expanduser('~') | |
| DESKTOP = os.path.join(HOME, 'Desktop') | |
| DESKTOP_FILES = os.listdir(DESKTOP) | |
| SCREEN_SHOT_DIR = os.path.join(HOME, 'Pictures', 'Screenshots') | |
| SCREEN_SHOTS = filter(lambda f: f.startswith('Screen Shot'), DESKTOP_FILES) |
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
| class KeyNotFoundException(Exception): | |
| pass | |
| class NotANodeError(TypeError): | |
| pass | |
| class Node(object): | |
| def __init__(self, value, next=None): | |
| self.__value__ = value |
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
| namespace :export do | |
| desc "Prints code for seed files" | |
| task :seeds_format, [:limit] => :environment do |t, args| | |
| limit = args.limit.to_i | |
| raise "Please provide a limit" if limit.zero? | |
| models.each do |model| | |
| model.all.limit(limit).each do |country| | |
| puts "#{model.to_s}.create(#{country.serializable_hash.delete_if {|key, value| ['created_at','updated_at','id'].include?(key)}.to_s.gsub(/[{}]/,'')})" | |
| end |
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
| apt-get install -y git | |
| apt-get install -y build-essential | |
| # Install node 4.X line | |
| curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - | |
| apt-get install -y nodejs | |
| # Install RVM | |
| gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
| curl -sSL https://get.rvm.io | bash -s stable |
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
| echo "Pulling branch master" | |
| git pull origin master | |
| echo "Building static site" | |
| node ./scripts/build.js | |
| echo "Moving build to /srv/" | |
| cp -R ./build /srv/ | |
| echo "Kicking over NGINX" |
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
| _ _.-''''''--._ | |
| .` `. ...------.\ | |
| / |O :-` _,.,---' | |
| ' \ ;--'' | |
| | _.' ( | |
| ,' _,' `-. | |
| : / '. | |
| \ \ ' | |
| `.| `. | |
| `-._ \ |
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
| #include <Arduino.h> | |
| #include <ESP8266WiFi.h> | |
| ///////////////////////////////// | |
| // WiFi Network Name: LED FLIP // | |
| //////////////////////////////// | |
| ///////////////////////////// | |
| // IP Address: 192.168.4.1 // | |
| //////////////////////////// |
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
| #include <Arduino.h> | |
| #include <ESP8266WiFi.h> | |
| ///////////////////////////////// | |
| // WiFi Network Name: LED FLIP // | |
| //////////////////////////////// | |
| ///////////////////////////// | |
| // IP Address: 192.168.4.1 // | |
| //////////////////////////// |