Skip to content

Instantly share code, notes, and snippets.

View nolanamy's full-sized avatar
🤫

Nolan Amy nolanamy

🤫
View GitHub Profile
a = function () { document.location = 'data:Application/octet-stream,' + encodeURIComponent('https://mail.google.com/mail/u/0/?ui=2&ik=e1913f44b3&view=att&th=13d665d8231c76ab&attid=0.1&disp=safe&realattid=f_he976fi52&zw'); }
b = function () { document.location = 'data:Application/octet-stream,' + encodeURIComponent('https://mail.google.com/mail/u/0/?ui=2&ik=e1913f44b3&view=att&th=13d665d8231c76ab&attid=0.2&disp=safe&realattid=f_he97711p3&zw'); }
c = function () { a(); setTimeout(b, 100); }
c();
##
# This file is auto-generated. DO NOT EDIT!
#
require 'protobuf/message'
module Greeting_Api
##
# Message Classes
#
package greeting_api;
message Greeting
{
optional string message = 1;
}
message simple_mail
{
optional string body = 1;
}
message mail_list
{
repeated simple_mail simple_mails = 1;
}
##
# This file is auto-generated. DO NOT EDIT!
#
require 'protobuf/message'
##
# Message Classes
#
class simple_mail < ::Protobuf::Message; end
static String colorToString(int color)
{
return new String(
" a:" + Color.alpha(color) +
" r:" + Color.red(color) +
" g:" + Color.green(color) +
" b:" + Color.blue(color)
);
}
function JSON2CSV(objArray) {
var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;
var str = '';
var line = '';
if ($("#labels").is(':checked')) {
var head = array[0];
if ($("#quote").is(':checked')) {
for (var index in array[0]) {
@nolanamy
nolanamy / dotgraph.rb
Last active January 3, 2016 04:29
Graph time-based data in irb
#example data
data = [
{
:time => Time.now - 2.days,
:value => 2321.65
},
{
:time => Time.now - 1.days,
:value => 1307.98
},
@nolanamy
nolanamy / PrettyDates.js
Last active August 29, 2015 13:57
Pretty dates
getDayName = function(day)
{
return {0:"Sunday",1:"Monday",2:"Tuesday",3:"Wednesday",4:"Thursday",5:"Friday",6:"Saturday"}[day];
};
getDayDiffString = function(now, before)
{
if((now - before) < 1000*60*60*24*5)
{
var dayDiff = now.getDay() - before.getDay();
@nolanamy
nolanamy / hat-collisions.js
Created April 21, 2015 19:05
Check for hat() collisions
var hat = require('hat');
var _ = require('lodash');
var rack = {};
for(var i = 0; i < 1000000; i++) {
var id = hat();
rack[id] = rack[id] ? rack[id] + 1 : 1;
}