Skip to content

Instantly share code, notes, and snippets.

View J-Rojas's full-sized avatar

J-Rojas

View GitHub Profile
@ahem
ahem / loadimage.js
Created October 18, 2016 12:59
Load and decode images with webworker
/* global createImageBitmap */
function loadImageWithImageTag(src) {
return new Promise((resolve, reject) => {
const img = new Image;
img.crossOrigin = '';
img.src = src;
img.onload = () => { resolve(img); };
img.onerror = () => { reject(img); };
});
@nnarain
nnarain / install.bash
Last active October 29, 2018 19:58
setup virtual can bus linux
#!/bin/bash
# install can-utils
git clone https://github.com/linux-can/can-utils.git
cd can-utils
./autogen.sh
./configure
make
sudo make install
@iwalpola
iwalpola / stm32_gpio_reg.md
Last active April 8, 2025 10:07
STM32 GPIO registers cheatsheet
@n-b
n-b / fp-obj-c.m
Created February 9, 2015 09:28
fp-obj-c
//#!/usr/bin/env objc-run
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#import <objc/message.h>
///
/// Typedefs
typedef id (^TargetMethod)(id arg);
@dinocore1
dinocore1 / Makefile
Created November 13, 2012 16:36
Build objc support for Android
# requires android ndkr8b or above
.PHONY: check-ndk clean
LIBOBJC2_MAKEFILE := libobjc2-1.6.1/Makefile
X86SYSROOT := $(shell pwd)/androidtoolchain-x86
ARMSYSROOT := $(shell pwd)/androidtoolchain-arm
GCC_X86 := $(X86SYSROOT)/bin/i686-android-linux-gcc
GCC_ARM := $(ARMSYSROOT)/bin/arm-linux-androideabi-gcc
LLVM_CONFIGURE := llvm/configure
@iamamused
iamamused / Readme.md
Created February 21, 2012 03:10
Set Ant build properties from JSON

Example:

Jeffreys-MacBook-Air$ ant example
Buildfile: /Users/jsambells/Documents/example/build.xml
    [echo] Parsing properties
    [echo] greeting=Hello
    [echo] audience=world
example:

[echo] Hello world