Skip to content

Instantly share code, notes, and snippets.

View thomasantony's full-sized avatar

Thomas Antony thomasantony

View GitHub Profile
@rmorgans
rmorgans / config.can
Created January 15, 2015 02:50
linux kernel config notes for socketcan
#
# Intel SoC IOSF Sideband support for SoC platforms
#
# To be selected by modules requiring access to the Intel OnChip
# System Fabric (IOSF) Sideband MailBox Interface (MBI). For MBI
# platforms enumerable by PCI. This option enables sideband register
# access support for Intel SoC platforms. On these platforms the IOSF
# sideband is used in lieu of MSR's for some register accesses, mostly
# but not limited to thermal and power. Drivers may query the
@JasonGhent
JasonGhent / pi_qemu.sh
Last active March 24, 2024 14:36
OSX raspberry pi emulation via QEMU. v2 attempt @ https://gist.github.com/JasonGhent/922f38f57c8cb77b10f3
# pulled from http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/
# expanded via http://superuser.com/questions/690060/how-to-enable-network-with-a-raspberry-pi-emulated-on-qemu
# tested with 2015-02-16-raspbian-wheezy.zip on OSX Mavericks
# OSX terminal
brew install qemu
# kernel-qemu is a linux kernel compiled with ARM1176 support.
# learn more here: http://xecdesign.com/compiling-a-kernel/
curl -OL http://xecdesign.com/downloads/linux-qemu/kernel-qemu
curl -o raspbian_latest.zip -L http://downloads.raspberrypi.org/raspbian_latest
@techfort
techfort / electroloki
Created May 1, 2015 12:38
basic loading of LokiJS in an electron app
var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
var loki = require('lokijs'),
db = new loki(),
users = db.addCollection('users', {
indices: ['username']
});
users.insert({ username: 'joe', age: 40});
users.insert({ username: 'jack', age: 30});
@floer32
floer32 / _socket_toggle.py
Last active December 18, 2019 20:31
Disable the internet in Python. With py.test hooks. (Disable socket.socket.) GREAT for unit testing.
from __future__ import print_function
import socket
import sys
_module = sys.modules[__name__]
def disable_socket():
""" disable socket.socket to disable the Internet. useful in testing.
.. doctest::
@RobbieClarken
RobbieClarken / SettingUpRaspberryPi.md
Last active January 5, 2019 14:13
Instructions for setting up a Raspberry Pi

Installing OS to SD card

  1. Download Raspbian.
  2. Install to SD card: Linux / Mac

Remove Junk

sudo apt-get remove --purge wolfram-* minecraft-pi scratch penguinspuzzle nano
sudo apt-get autoremove
@justanr
justanr / _core.py
Last active September 10, 2024 19:53
Clean Architecture In Python
from abc import ABC, ABCMeta, abstractmethod
from collections import namedtuple
from itertools import count
PayloadFactory = namedtuple('PayloadFactory', [
'good', 'created', 'queued', 'unchanged', 'requires_auth',
'permission_denied', 'not_found', 'invalid', 'error'
])
"""
@DaveThw
DaveThw / mosquitto
Last active December 24, 2017 15:59
init.d script for mosquitto (on a Raspberry Pi)
#!/bin/bash
### BEGIN INIT INFO
# Provides: mosquitto
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop the mosquitto service
### END INIT INFO
@ryzy
ryzy / a.sh
Last active July 19, 2021 02:22
Compile OpenSSL 1.0.2 and HAProxy from the source on CentOS 7
# make sure you have these installed
yum install -y make gcc perl pcre-devel zlib-devel

Important: At the time of writing (2019-11-11) Immutable.js is effectively abandonware, so I can no longer recommend anyone to follow the advice given here. I'll leave the article here for posterity, since it's still getting some traffic.

Understanding Immutable.Record

Functional programming principles and with it immutable data are changing the way we write frontend applications. If the recent de-facto frontend stack of React and Redux feels like it goes perfectly together with immutable data, that's because it's specifically designed for that.

There's several interesting implementations of immutable data for JavaScript, but here I'll be focusing on Facebook's own Immutable.js, and specifically on one of i

@blakev
blakev / background_tasks.py
Last active October 19, 2017 21:10
Background tasks manager for gevent Greenlets
#!/usr/bin/env python3
# ~*~ coding: utf-8 ~*~
#
# >>
# .. created: 5/20/16
# .. author: blake.vandemerwe
#
# LICENSE
# <<