Skip to content

Instantly share code, notes, and snippets.

View relic7's full-sized avatar

relic7

  • Cisco Systems, Inc.
  • Raleigh, NC
View GitHub Profile
@byrney
byrney / multi-queue.py
Created December 7, 2016 06:57
Share state between python coprocesses
import time
import random
from multiprocessing import Process, Queue, current_process, freeze_support
#
# Function run by worker processes
#
def worker(state, input, output):
@anttti
anttti / lego-space.csv
Created December 7, 2016 06:41
Lego Space Kit Names
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 9.
SetID,Number,Variant,Theme,Subtheme,Year,Name,Minifigs,Pieces,UKPrice,USPrice,CAPrice,EUPrice,ImageURL
7522,"0012","1","Space","","1979","Space minifigures",2,4,,,,,"http://images.brickset.com/sets/images/0012-1.jpg"
7523,"0013","1","Space","","1979","Space minifigures",2,4,,,,,"http://images.brickset.com/sets/images/0013-1.jpg"
7524,"0014","1","Space","","1979","Space minifigures",2,4,,,,,"http://images.brickset.com/sets/images/0014-1.jpg"
7563,"0015","1","Space","","1979","Space Mini-Figures",3,18,,,,,"http://images.brickset.com/sets/images/0015-1.jpg"
9581,"54","1","Space","UFO","1997","UFO Action Pack",,96,,,,,"http://images.brickset.com/sets/images/54-1.jpg"
1273,"305","1","Space","Classic","1979","Two Crater Plates",,2,,,,,"http://images.brickset.com/sets/images/305-1.jpg"
1284,"306","1","Space","Classic","1979","Two Lunar Landing Plates",,2,,,,,"http://images.brickset.com/sets/images/306-1.jpg"
2104,"442","1","Space","Classic","1979","Space Shuttle",1,39,,,,,"http://images.brickset.com/sets/images/442-
@zachdrago
zachdrago / gridme.css
Last active April 13, 2016 03:21
Lightbox.me
/*
Simple Grid
Project Page - http://thisisdallas.github.com/Simple-Grid/
Author - Dallas Bass
Site - http://dallasbass.com
*/
*, *:after, *:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
@thirukkural2022
thirukkural2022 / unix rename many files
Created April 11, 2016 02:22
unix rename many files
for j in *.txt; do mv -v -- "$j" "${j%.txt}.log"; done
anonymous
anonymous / untrusted-lvl6-solution.js
Created April 11, 2016 02:19
Solution to level 6 in Untrusted: http://alex.nisnevich.com/untrusted/
/****************
* drones101.js *
****************
*
* Do you remember, my dear Professor, a certain introductory
* computational rationality class you taught long ago? Assignment
* #2, behavior functions of autonomous agents? I remember that one
* fondly - but attack drones are so much easier to reason about
* when they're not staring you in the face, I would imagine!
string_tipe = ", ".join('"%s"' % i for i in split_tipe)
import random
class Board(object):
def __init__(self):
self.board = [[" "," "," "], [" "," "," "], [" "," "," "]]
def print_board(self):
topstr = " a b c"
linestr = " +-----+-----+-----+"
rowstr = "%s | %s | %s | %s |"
@macedo
macedo / ajax_queue.js
Created January 29, 2015 18:21
Ajax requests queue
var AjaxQueue = {
batchSize: 1,
urlQueue: [],
elementsQueue: [],
optionsQueue: [],
setBatchSize: function(bSize) {
this.batchSize = bSize;
},
push: function(url, options, elementID) {
this.urlQueue.push(url);
@relic7
relic7 / ajax_get.js
Created May 30, 2014 06:44 — forked from dmulvi/ajax_get.js
Simple jQuery ajax GET request
/*
* Task 2 - fetch some db results via ajax call and display in a table.
*/
var admixt_task2 = {
url: '/followers',
fetch: function(){
var self = this;
$.get(this.url)
@dmulvi
dmulvi / ajax_get.js
Last active August 29, 2015 14:02
Simple jQuery ajax GET request
/*
* Task 2 - fetch some db results via ajax call and display in a table.
*/
var admixt_task2 = {
url: '/followers',
fetch: function(){
var self = this;
$.get(this.url)