Skip to content

Instantly share code, notes, and snippets.


Sam Sulaimanov bitmorse

View GitHub Profile
View gist:4952575
$(".result a").click(function(){
hrefa = $(this).closest('.result').children('a').context.href;
dsid = $(this).closest('.result').attr('rel');
resc = ''; //set this to the result count
async: false,
type: "POST",
bitmorse /
Created Mar 20, 2013
lastfm scrobble exporter (from // changed the script to try more often on failure )
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
bitmorse / gist:5362657
Created Apr 11, 2013
plos publication example (json)
View gist:5362657
"_id": ObjectId("51642d36ad89aa81926ae005"),
"abstract": [
"\n We study a credit network and, in particular, an interbank system with an agent-based model. To understand the relationship between business cycles and cascades of bankruptcies, we model a three-sector economy with goods, credit and interbank market. In the interbank market, the participating banks share the risk of bad debits, which may potentially spread a bank’s liquidity problems through the network of banks. Our agent-based model sheds light on the correlation between bankruptcy cascades and the endogenous economic cycle of booms and recessions. It also demonstrates the serious trade-off between, on the one hand, reducing risks of individual banks by sharing them and, on the other hand, creating systemic risks through credit-related interlinkages of banks. As a result of our study, the dynamics underlying the meltdown of financial markets in 2008 becomes much better understandable.\n "
"affiliate": [
View gist:5375964
#include <SoftwareSerial.h>
#include <SdFat.h>
#include <TinyGPS.h>
const int chipSelect = 4;
// MOSI - pin 11 yellow middle
// MISO - pin 12 yellow right
// CLK - pin 13 blue
// CS - pin 4 green

Keybase proof

I hereby claim:

  • I am bitmorse on github.
  • I am bitmorse ( on keybase.
  • I have a public key whose fingerprint is 0B52 D8EE A461 4875 EEDB 0F89 8550 EAE8 C1DD 950A

To claim this, I am signing this object:

bitmorse / ps3controller_test.js
Created Jan 25, 2016
View ps3controller_test.js
"use strict";
var GamePad = require( 'node-gamepad' );
var Cylon = require('cylon');
var controller = new GamePad( 'ps3/dualshock3' );
var rover_state = {
View vizviewTTN.json
{"version":"2.38.1-0","grid":{"layers":{"View All":{"name":"View All"},"Default layer":{"name":"Default layer"}},"xWidth":10,"yHeight":10},"modules":[{"url":"modules/types/server_interaction/webservice_search/","configuration":{"sections":{"postvariables":[{"sections":{},"groups":{"postvariables":[[{"destination":"data","filter":"none"}]]}}]},"groups":{"group":[{"url":[""],"method":["GET"],"dataType":["form"],"withCredentials":[[]],"showStatus":[[]],"button":[["button"]],"buttonlabel":["Refresh Gateways"],"buttonlabel_exec":["Refreshing Gateways..."],"onloadsearch":[["button"]],"debounce":[0],"resultfilter":["return data;"],"askConfirm":[[]],"confirmText":["Are you sure?"]}],"headers":[[{}]],"searchparams":[[{"destination":"url","fieldtype":"text"}]]}},"layers":{"View All":{"position":{"left":121,"top":0},"size":{"width":16,"height":8},"zIndex":0,"display":true,"title":"","bgColor":[255,255,255,0],"wrapper":true,"created":true,"name":"Default layer"},"Defaul
bitmorse / untitled
Created Mar 13, 2016
View untitled
case $1 in
/usr/bin/python /home/pi/zim/ >/home/pi/log &
echo $! > ${PIDFILE};
kill `cat ${PIDFILE}` ;;
bitmorse /
Created Aug 16, 2016
hacky checkpoint with rfid card reader
import serial
import sys
import wiringpi
from time import sleep
import Adafruit_Nokia_LCD as LCD
import Adafruit_GPIO.SPI as SPI
from simplemysql import SimpleMysql
from threading import Thread
from PIL import Image
View eng209_exo2.cpp
* exo2.cpp
* Created on: Oct 3, 2016
* Author: sam
#include <vector>
#include <iostream>
using namespace std;