Skip to content

Instantly share code, notes, and snippets.

View JavaCS3's full-sized avatar
😑
Working

Charles Wei JavaCS3

😑
Working
View GitHub Profile
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
@bgreenlee
bgreenlee / logging_subprocess.py
Created November 29, 2011 00:58
Variant of subprocess.call that accepts a logger instead of stdout/stderr #python
import subprocess
import select
from logging import DEBUG, ERROR
def call(popenargs, logger, stdout_log_level=DEBUG, stderr_log_level=ERROR, **kwargs):
"""
Variant of subprocess.call that accepts a logger instead of stdout/stderr,
and logs stdout messages via logger.debug and stderr messages via
logger.error.
@FredEckert
FredEckert / framebuffer.c
Created August 22, 2012 13:15
Paint Pixels to Screen via Linux FrameBuffer
/*
To test that the Linux framebuffer is set up correctly, and that the device permissions
are correct, use the program below which opens the frame buffer and draws a gradient-
filled red square:
retrieved from:
Testing the Linux Framebuffer for Qtopia Core (qt4-x11-4.2.2)
http://cep.xor.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html
*/
@countrymarmot
countrymarmot / timeout.py
Created December 26, 2013 05:10
decorator to calculate python function timeout and elapsed time.
import signal
import time
from functools import wraps
class TimeoutException(Exception):
pass
def timethis(func):
@Liryna
Liryna / ARMDebianUbuntu.md
Last active May 20, 2024 15:04
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

@orbitbot
orbitbot / index.html
Created October 23, 2014 21:43
Ace editor with http-link highlighting and click action, from http://jsbin.com/jehopaja/30/edit?html,output
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="http://ajaxorg.github.io/ace-builds/src/ace.js"></script>
<style>
#editor { position: absolute; top: 0; left: 0; right: 0; bottom: 0;}
.ace_link_marker {
position: absolute;
@monteslu
monteslu / firmataclient.js
Last active September 10, 2018 09:07
firmata over tcp
var net = require('net');
var five = require('johnny-five');
var firmata = require('firmata');
var client = net.connect({port: 8124}, function() { //'connect' listener
console.log('connected to server!');
console.log('connected to server event!');
var io = new firmata.Board(this);
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude (quill18@quill18.com)
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2015-04-16: Changed Pool to use a Stack generic.
///
/// Usage:
///
@chinshr
chinshr / Jenkinsfile
Last active October 16, 2023 09:25
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
@eestrada
eestrada / sqlite_regex.py
Last active December 21, 2023 13:46
How to do regular expressions in sqlite3 (using python).
#!/usr/bin/env python
"""How to do regular expressions in sqlite3 (using python)."""
from __future__ import division, absolute_import, print_function, unicode_literals
import re
import sys
import time
import datetime
import sqlite3