Skip to content

Instantly share code, notes, and snippets.

View bitmorse's full-sized avatar
👋

Sam Sulaimanov bitmorse

👋
View GitHub Profile
$(".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
$.ajax({
async: false,
type: "POST",
@bitmorse
bitmorse / lastexport.py
Created March 20, 2013 00:51
lastfm scrobble exporter (from https://gitorious.org/fmthings/lasttolibre/blobs/master/lastexport.py // 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
bitmorse / gist:5362657
Created April 11, 2013 11:30
plos publication example (json)
{
"_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": [
"Departme
#include <SoftwareSerial.h>
#include <SdFat.h>
#include <TinyGPS.h>
//SD
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 (https://keybase.io/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
bitmorse / ps3controller_test.js
Created January 25, 2016 14:23
octanis1_rover_ds3_controller
"use strict";
var GamePad = require( 'node-gamepad' );
var Cylon = require('cylon');
var controller = new GamePad( 'ps3/dualshock3' );
var rover_state = {
{"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":["https://crossorigin.me/http://ttnstatus.org/gateways"],"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
bitmorse / untitled
Created March 13, 2016 15:57
new_zim_run_for_monit
#!/bin/bash
PIDFILE=/var/run/zim_run.pid
case $1 in
start)
/usr/bin/python /home/pi/zim/mapa.py >/home/pi/log &
echo $! > ${PIDFILE};
;;
stop)
kill `cat ${PIDFILE}` ;;
@bitmorse
bitmorse / rfid_reader.py
Created August 16, 2016 12:26
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
/*
* exo2.cpp
*
* Created on: Oct 3, 2016
* Author: sam
*/
#include <vector>
#include <iostream>
using namespace std;