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
# Code Snipet for demonstrating the use of nokogiri | |
# The code will look up yor retired racing greyhound by its racing name | |
# And return info about your dog as well as a list of its litter mates. | |
# | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'uri' |
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 bash | |
uuid_str=$(/usr/local/bin/uuid) | |
dir="/Users/my-account/my-wiki/images/" | |
target="$dir$uuid_str.png" | |
var=$(/usr/local/bin/pngpaste $target 2>&1) | |
if [ "$var" == "No PNG data found on the clipboard!" ]; | |
then | |
echo "No-PNG" | |
else | |
echo "[![$uuid_str.png](images/$uuid_str.png)](images/$uuid_str.png)" |
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
require 'graphviz' | |
# Create a new graph | |
g = GraphViz.new( :G, :type => :digraph ) | |
us_num = 47 #placeholder, will get from file name in final version. | |
# set global node options | |
g.node[:color] = "#333333" | |
g.node[:style] = "filled" | |
g.node[:shape] = "box" |
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
require 'rubygems' | |
require 'state_machine' | |
class Item | |
attr_accessor :name, :description | |
state_machine :item_state, :initial => :available do | |
after_transition :available=> :completed, :do => :item_completed |
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
require 'goliath' | |
require 'em-synchrony' | |
require 'em-synchrony/em-mongo' | |
require 'grape' | |
require './app/models/mission.rb' | |
require './app/models/player.rb' | |
module MyAppName | |
class API_v1 < Grape::API | |
prefix 'api' |
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 MDListParser | |
attr_accessor :lists | |
%%{ | |
machine test_lexer; | |
action MarkTaskStart { | |
task_start = fpc |
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
## Tasks | |
- Go to Whole Foods | |
- Go to produce section | |
- get oranges | |
maybe Mandarine and Valencia | |
- get avocados | |
- get squash | |
maybe buttercup if they have it | |
- Go to bakery section | |
- get bagels |
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
## Tasks | |
- Go to Whole Foods | |
- Go to produce section | |
- get oranges | |
maybe Mandarine and Valencia | |
- get avocados | |
- get squash | |
maybe buttercup if they have it | |
- Go to bakery section | |
- get bagels |
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 init_restkit_logging | |
#define RKLogLevelOff -> RKlcl_vOff | |
#define RKLogLevelCritical -> RKlcl_vCritical | |
#define RKLogLevelError -> RKlcl_vError | |
#define RKLogLevelWarning -> RKlcl_vWarning | |
#define RKLogLevelInfo -> RKlcl_vInfo | |
#define RKLogLevelDebug -> RKlcl_vDebug | |
#define RKLogLevelTrace -> RKlcl_vTrace | |
# "restkit" "RestKit" |
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
(defun quick-copy-line () | |
"Copy the whole line that point is on and move to the beginning of the next line. | |
Consecutive calls to this command append each line to the | |
kill-ring." | |
(interactive) | |
(let ((beg (line-beginning-position 1)) | |
(end (line-beginning-position 2))) | |
(if (eq last-command 'quick-copy-line) | |
(kill-append (buffer-substring beg end) (< end beg)) | |
(kill-new (buffer-substring beg end)))) |
OlderNewer