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
| awk '{a[$0]++}END{for (i in a) print i"\t"a[i]}' | |
| perl -lne '++$a{$_} }{ print "$_\t$a{$_}" for keys %a' |
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
⠝⠑⠗⠙ |
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
# | |
yum install net-snmp.x86_64 | |
mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig | |
scp root@$IP:/etc/snmp/snmpd.conf /etc/snmp/snmpd.conf | |
chkconfig snmpd on | |
service snmpd start |
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
<?php | |
/** | |
* Input an object, returns a json-ized string of said object, pretty-printed | |
* | |
* @author Unknown | |
* @param mixed $obj The array or object to encode | |
* @return string JSON formatted output | |
*/ | |
function json_encode_pretty($obj, $indentation = 0) { | |
switch (gettype($obj)) { |
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
// Step 1: | |
// Retrieve test image: | |
// wget http://s3.amazonaws.com/tastrix/440/large_orig/shiso_trans.png | |
// | |
// Step 2: | |
// Then, run this through node.js | |
// | |
// Step 3: | |
// Inspect shade_test.png; the overlayed squares have drop shadow with Gaussian blur, the circle of leaves does not | |
var Canvas = require('canvas') |
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
### Setup | |
mkdir 2_models_1_view | |
rails new 2_models_1_view | |
rails g scaffold Parent name:string age:integer | |
rails g scaffold Children toy:string hair:string eyes:string parent_id:integer | |
rake db:migrate |
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
diff --git a/app/controllers/parents_controller.rb b/app/controllers/parents_controller.rb | |
index 4f6831f..ce6c226 100644 | |
--- a/app/controllers/parents_controller.rb | |
+++ b/app/controllers/parents_controller.rb | |
@@ -25,6 +25,7 @@ class ParentsController < ApplicationController | |
# GET /parents/new.json | |
def new | |
@parent = Parent.new | |
+ @parent.children.build | |
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
diff --git a/app/controllers/parents_controller.rb b/app/controllers/parents_controller.rb | |
index 4f6831f..ce6c226 100644 | |
--- a/app/controllers/parents_controller.rb | |
+++ b/app/controllers/parents_controller.rb | |
@@ -25,6 +25,7 @@ class ParentsController < ApplicationController | |
# GET /parents/new.json | |
def new | |
@parent = Parent.new | |
+ @parent.children.build | |
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 bash | |
# filter out the noisy asset pipeline | |
tail -f ./log/development.log | egrep -v "(^$|GET|Served)" |
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 bash | |
ps aux | fgrep 'ruby script/rails s -d' | awk '{print $2}' | xargs kill -9 |
OlderNewer