Skip to content

Instantly share code, notes, and snippets.

Patrick Goddi fooqri

Block or report user

Report or block fooqri

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fooqri
fooqri / lists.txt
Last active Dec 11, 2015
A simple Ragel example for parsing a markdown styled todo list.
View lists.txt
## 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
@fooqri
fooqri / mdlist_parser.rl
Created Jan 19, 2013
A simple Ragel example for parsing a markdown style list.
View mdlist_parser.rl
class MDListParser
attr_accessor :lists
%%{
machine test_lexer;
action MarkTaskStart {
task_start = fpc
@fooqri
fooqri / lists.txt
Created Jan 19, 2013
A simple list for a Ragel example
View lists.txt
## 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
View grape_example.rb
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'
View simple_graphviz_example.rb
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"
@fooqri
fooqri / ImageToMMD.bash
Created Dec 17, 2012
TextExpander snippet for saving clipboard image to disk and writing markdown link for it.
View ImageToMMD.bash
#!/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)"
@fooqri
fooqri / nokogiri_greyhound_search
Created Feb 17, 2012
Ruby Nokogiri usage example
View nokogiri_greyhound_search
View MyIntelEdisonSetupGuide.md

Intel Edison Setup

Flash Edison with latest Image (Linux)

  • Plug both micro USB cables from Edison Dev board into linux pc, no power wall wart needed

in terminal (ttyUSB0 is example, could be ttyUSB1, etc based on usb port used.)

  • open a terminal and type sudo screen /dev/ttyUSB0 115200
  • reset edison using reset button
  • keep hitting a key until stop boot at a boot prompt
  • type run do_flash
You can’t perform that action at this time.