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
module HashConverter | |
class << self | |
def to_underscore hash | |
convert hash, :underscore | |
end | |
def to_camel_case hash | |
convert hash, :camelize | |
end | |
def convert obj, *method | |
case obj |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
def mad_based_outlier(points, thresh=3.5): | |
if len(points.shape) == 1: | |
points = points[:,None] | |
median = np.median(points, axis=0) | |
diff = np.sum((points - median)**2, axis=-1) | |
diff = np.sqrt(diff) | |
med_abs_deviation = np.median(diff) | |
modified_z_score = 0.6745 * diff / med_abs_deviation |
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
package hello | |
import ( | |
"fmt" | |
"net/http" | |
"github.com/gorilla/mux" | |
) | |
func init() { |
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 updated::config { | |
file { '/updated/bin/': | |
ensure => directory, | |
recurse => true, | |
purge => true, | |
force => true, | |
owner => root, | |
group => root, | |
mode => 775, |
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
https://rubygems.org/downloads/vagrant-berkshelf-4.1.0.gem | |
https://rubygems.org/downloads/vagrant-aws-0.6.0.gem | |
https://rubygems.org/downloads/vagrant-omnibus-1.4.1.gem | |
http://cloud.ja.sonbarnett.com/2P3m4545222l | |
http://cloud.ja.sonbarnett.com/1E3K39143h0j |
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 ruby | |
# Use the currently configured ruby version | |
# I could not get this to work on v1.8.7, only v1.9.3 | |
# optparse contains OptionParser, ostruct: OpenStruct and growl Growl | |
require 'optparse' | |
require 'ostruct' | |
require 'growl' | |
# This is the name of the script that is called |
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
server { | |
listen 80; | |
server_name accessphase.mydomain.com; | |
rewrite ^ https://accessphase.mydomain.com$request_uri permanent; | |
} | |
server { | |
listen 192.168.97.208:443; | |
server_name accessphase.mydomain.com; | |
root /opt/nginx/accessphase.mydomain.com/public_html; |
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 | |
srpm_url=$1 | |
srpm=`basename $srpm_url` | |
srpm_name=`echo $srpm | sed -r 's|-[0-9]+.*$||g'` | |
cat <<EOF | |
## Setting up tree for: ## | |
########################## |
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 | |
# on centos minimal | |
yum install gcc | |
yum install make | |
yum install ncurses-devel | |
yum install lua lua-devel | |
yum install ruby ruby-devel | |
yum install python python-devel | |
yum install perl perl-devel |