Skip to content

Instantly share code, notes, and snippets.

View dpzmick's full-sized avatar

David Zmick dpzmick

View GitHub Profile
@dpzmick
dpzmick / gist:5119556
Created March 8, 2013 20:23
Only the first occurrence of "created_at" is held as a date. Additionally :user now points to a user object, not a hash.
[27] pry(main)> tweet.to_hash
=> {:created_at=>2013-03-08 13:40:22 -0600,
:id=>310112778675425281,
:id_str=>"310112778675425281",
:text=>"post a twitter.",
:source=>"web",
:truncated=>false,
:in_reply_to_status_id=>nil,
:in_reply_to_status_id_str=>nil,
:in_reply_to_user_id=>nil,
[8] pry(main)> tweet.attrs
=> {:created_at=>2010-10-16 12:07:46 -0500,
:id=>27558893223,
:text=>"Ruby is the best programming language for hiding the ugly bits.",
:source=>"<a href=\"http://www.echofon.com/\" rel=\"nofollow\">Echofon</a>",
:truncated=>false,
:in_reply_to_status_id=>nil,
:in_reply_to_user_id=>nil,
:in_reply_to_screen_name=>nil,
:user=>
+-o Root <class IORegistryEntry, id 0x100000100, retain 11>
+-o MacBook5,1 <class IOPlatformExpertDevice, id 0x100000110, registered, matched, active, busy 0 (467566 ms), retain 26>
+-o AppleACPIPlatformExpert <class AppleACPIPlatformExpert, id 0x100000111, registered, matched, active, busy 0 (386444 ms), retain 49>
| +-o IOPMrootDomain <class IOPMrootDomain, id 0x100000114, registered, matched, active, busy 0 (14 ms), retain 101>
| | +-o IORootParent <class IORootParent, id 0x100000115, !registered, !matched, active, busy 0, retain 7>
| | +-o RootDomainUserClient <class RootDomainUserClient, id 0x1000002d7, !registered, !matched, active, busy 0, retain 5>
| | +-o RootDomainUserClient <class RootDomainUserClient, id 0x1000002da, !registered, !matched, active, busy 0, retain 5>
| | +-o RootDomainUserClient <class RootDomainUserClient, id 0x1000002db, !registered, !matched, active, busy 0, retain 5>
| | +-o RootDomainUserClient <class RootDomainUserClient, id 0x1000002dc,
@dpzmick
dpzmick / fibs_blink.js
Last active December 21, 2015 02:58
Fibs on beaglebone!
'{"resources":5300,"responseCode":400,"playerToken":"WSvwRdGqRGhvWAXf1pt4IA==","playerName":"Sprinkles","error":["It is not your turn!"],"hitReport":[],"ships":[{"orientation":"H","xCoord":5,"ID":5,"yCoord":5,"type":"M","health":40},{"orientation":"H","xCoord":70,"ID":6,"yCoord":60,"type":"D","health":40},{"orientation":"V","xCoord":97,"ID":7,"yCoord":57,"type":"D","health":40},{"orientation":"V","xCoord":17,"ID":8,"yCoord":38,"type":"P","health":20},{"orientation":"H","xCoord":54,"ID":9,"yCoord":96,"type":"P","health":20}],"pingReport":[],"shipActionResults":[]}\n{"resources":5300,"responseCode":100,"playerToken":"WSvwRdGqRGhvWAXf1pt4IA==","playerName":"Sprinkles","error":[],"hitReport":[{"xCoord":2,"hit":false,"yCoord":1},{"xCoord":3,"hit":false,"yCoord":1}],"ships":[{"orientation":"H","xCoord":5,"ID":5,"yCoord":5,"type":"M","health":40},{"orientation":"H","xCoord":70,"ID":6,"yCoord":60,"type":"D","health":40},{"orientation":"V","xCoord":97,"ID":7,"yCoord":57,"type":"D","health":40},{"orientation":"V","xCoo
before print
{"resources":5170,
"responseCode":400,
"playerToken":"wr7/FxIABaZe8GiJn1RRZw==",
"playerName":"Sprinkles",
"error":["It is not your turn!"],
"hitReport":[],
"ships":
[{"orientation":"H","xCoord":5,"ID":5,"yCoord":5,"type":"M","health":40},
#include <stdio.h>
#include <stdlib.h>
void fancy_function( void * a ) {
unsigned char * bytes = (unsigned char *) &a ;
size_t i;
for (i = 0; i < 8; i++) {
printf("%d\n", bytes[i]);
}
function make_node(value) {
return {
value: value,
next: null,
};
}
var first = make_node(1);
var second = make_node(2);
var third = make_node(4);
let rec read_inp () =
try
let i = read_float() in
i::(read_inp ())
with End_of_file -> []
;;
(* todo tail recursive *)
let rec fact = function
| 1 -> 1
package htmlEditor;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import java.awt.datatransfer.*;
import javax.swing.undo.*;
import javax.swing.event.*;
import javax.swing.text.*;
import java.util.*;