Redis is an in-memory network key/value store and nltk is the python natural language toolkit. We'll be using these libraries later for the lab.
import redis
import nltk
Setup our redis connection. It's on the VM, so local is fine.
Redis is an in-memory network key/value store and nltk is the python natural language toolkit. We'll be using these libraries later for the lab.
import redis
import nltk
Setup our redis connection. It's on the VM, so local is fine.
#!/bin/bash | |
. /usr/share/foreman/config/hooks.d/lib/utils.sh | |
. $FOREMAN_HOME/config/hooks.d/lib/hook_functions.sh | |
set -x | |
IP=$(hook_data host.ip) | |
DNSNAME=$(hook_data host.name) | |
REVERSE=$(reverseIp ${IP}) | |
rdns_create() { | |
echolog IP ${IP} calling nsupdate: dns3.server.name update add ${REVERSE}.in-addr.arpa. 86400 PTR $DNSNAME |
require 'plist' | |
def conv_color_component(fval) | |
( 255.0 * fval ) .to_i | |
end | |
def conv_color(node) | |
r = conv_color_component(node['Red Component']) | |
g = conv_color_component(node['Green Component']) | |
b = conv_color_component(node['Blue Component']) |
############################################################################### | |
# The MIT License | |
# | |
# Copyright 2012-2014 Jakub Jirutka <[email protected]>. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D | |
rails_env = ENV['RAILS_ENV'] || 'production' | |
# 16 workers and 1 master | |
worker_processes (rails_env == 'production' ? 16 : 4) | |
# Load rails+github.git into the master before forking workers | |
# for super-fast worker spawn times | |
preload_app true |