Skip to content

Instantly share code, notes, and snippets.

View thenormalsquid's full-sized avatar
I'm your huckleberry

Thien-Bach Huynh thenormalsquid

I'm your huckleberry
View GitHub Profile
@thenormalsquid
thenormalsquid / newton.go
Created August 20, 2015 23:43
Newton approx
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
delta, z := float64(1), float64(1)
for delta > 1e-9 {
var asyncFunction = (param, callback) => {
window.setTimeout(() => {
callback(param);
}, 1);
};
var o = {
doSomething: function () {
// Here we pass `o` into the async function,
// expecting it back as `param`.
function playTheGame(event) {
var rows = world.stage.canvas.width,
cols = world.stage.canvas.height;
for(int r = 0; r < rows; r += cellHeight) {
for(int c = 0; c < cols; c += cellWidth) {
//form neighborhood here,
//count num cells
//return center cell, if it doesn't exist, add one
PID:
7589
run.sh: 4: run.sh: [[: not found
Connector not running. starting.
Traceback (most recent call last):
File "./bot.py", line 3, in <module>
from api import handlers
File "/home/squid/scaling-octo-robot/api/__init__.py", line 2, in <module>
from api.irc_actions import *
File "/home/squid/scaling-octo-robot/api/irc_actions.py", line 9
Ext.define('SkyNet.store.ActiveResidentsStore', {
extend: 'Ext.data.Store',
config: {
model: 'SkyNet.model.Resident',
sorters: 'LastName',
storeId: 'ActiveResidentsStore',
autoload: true,
grouper: {
groupFn: function (record) {
return record.get('LastName')[0];
@thenormalsquid
thenormalsquid / one.sh
Created January 23, 2015 05:54
one liner reddit thingy
curl --header "X-Ratelimit-Used: 1 User-Agent: radicalcakes" http://www.reddit.com/r/all.json?limit=10 | jsawk 'return this.data.children' | jsawk 'return this.data' | jsawk 'return this.url'
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1
owGbwMvMwMSouj46n71nXTrj6QPfkhhCtpi+qVZKyk+pVLKqVkrOyUzNKwGx8hJz
U5WslLJTK5MSi1P1MvMV8vJTUvWyihWganSUylKLijPz84CqDPTM9YyVanVAykGa
0zLz0lOLCooyQWYpWRqkWSYnJxuZmhslm5klmgDp1KQkE0OTROM0ozQLs7RkoxQz
M+MkoJEZ+cUlKLYqgc2Mz0wBipo4GrsZuVmYuTkbuQDVOwHlSsESpqlpycmGqSZm
SckWhklJqaaGxklJiWbmBhYWpgZmBgYghcWpRVAvFSWmZCYn5iQnZqcWg9wMlCnL
TE5F8nR6ZklGaRKqrpKM1Lz8otzEnOJCkKVAfSWVBSCJ8tSkeKgR8UmZeSlAryOH
jSFQZXJJJsgMQxMjQwNLMxMjCx2l1IqCzKLU+EyQClNzMwsDINBRKihKLVOyyivN
__author__ = 'radicalcakes'
import TCPHandler
test_json_obj = {
#hidden server sould do the conversion of originators and firstHopid
"originator": 2995272300,
"firstHop": 25721492,
"traceCount": 00,
"hopCount": 01,
"pti": 00,
Single-input UT EN1210: battery=ok, firstHopId=2491058177, hopCount=1, changed=NO, tamper=NO, reset=NO, trigger1=NO, trigger2=NO, trigger3=NO, trigger4=NO, status0=0x10, status1=0x0, rawMsg={72 12 B2 88 3A 6C 01 88 7A 94 00 01 3E 00 00 10 00 00 4A}
Single-input UT EN1210: battery=ok, firstHopId=2725939201, hopCount=1, changed=NO, tamper=NO, reset=NO, trigger1=NO, trigger2=NO, trigger3=NO, trigger4=NO, status0=0x10, status1=0x0, rawMsg={72 12 B2 88 3A 6C 01 88 7A A2 00 01 3E 00 00 10 12 12 7C}
@thenormalsquid
thenormalsquid / t1
Created January 5, 2015 05:06
tess
//
// FirstViewController.m
// Matchmaker
//
// Created by radicalcakes on 1/2/15.
// Copyright (c) 2015 matchmaker. All rights reserved.
//
#import "FirstViewController.h"
#import "ParseImageController.h"