Skip to content

Instantly share code, notes, and snippets.

View penk's full-sized avatar

Penk Chen penk

View GitHub Profile
@gbaman
gbaman / HowToOTGFast.md
Last active May 1, 2024 08:26
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@ggendre
ggendre / qml_side.js
Created September 10, 2013 10:12
BlackBerry10 AJAX Fix via QML fix ajax calls via a QML gateway. see story here (fr) : http://www.haploid.fr/blog/2013/09/10/blackberry10-et-ajax/
/* bind handleAjax native function to a message sent by the webview JavaScript
send result to webview
*/
WebView {
id : webview
onMessageReceived: {
try {
if (message && message.data) {
var jsonObj = JSON.parse(decodeURIComponent(message.data));
@codepo8
codepo8 / canvas-helper-tools.js
Last active December 17, 2015 15:29
Two handy helper routines for canvas work
// Get the canvas and the context
var c = document.querySelector('canvas');
var cx = c.getContext('2d');
// pixelcolour returns an object of rgba for the pixel at x and y
// great for checking if you are in a certain boundary or for
// colourpickers
function pixelcolour(x, y) {
var pixels = cx.getImageData(0, 0, c.width, c.height);
var index = ((y * (pixels.width * 4)) + (x * 4));
@fourdollars
fourdollars / dkms.sh
Last active January 23, 2017 09:09
Deprecated
https://github.com/fourdollars/scripts/blob/master/ubuntu/dkms-helper.sh
window.addEventListener "DOMContentLoaded", ->
body = $ "body"
canvas = $ "#canvas"
chalkboard = $ "#chalkboard"
close = $ "#close"
ledge = $ "#ledge"
lightswitch = $ "#lightswitch"
output = $ "#output"
shade = $ "#shade"
share = $ "#share"