Skip to content

Instantly share code, notes, and snippets.

View J-Rojas's full-sized avatar

J-Rojas

View GitHub Profile
@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

@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
@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);
@iwalpola
iwalpola / stm32_gpio_reg.md
Last active April 8, 2025 10:07
STM32 GPIO registers cheatsheet
@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
@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); };
});
@wonderbeyond
wonderbeyond / graceful_shutdown_tornado_web_server.py
Last active October 23, 2024 16:13 — forked from mywaiting/graceful_shutdown_tornado_web_server.py
The example to how to shutdown tornado web server gracefully...
#!/usr/bin/env python
"""
How to use it:
1. Just `kill -2 PROCESS_ID` or `kill -15 PROCESS_ID`,
The Tornado Web Server Will shutdown after process all the request.
2. When you run it behind Nginx, it can graceful reboot your production server.
"""
import time
@Hebali
Hebali / GlslSobel.frag
Created January 12, 2017 17:25
GLSL Fragment Shader: Sobel Edge Detection
// Sobel Edge Detection Filter
// GLSL Fragment Shader
// Implementation by Patrick Hebron
uniform sampler2D texture;
uniform float width;
uniform float height;
void make_kernel(inout vec4 n[9], sampler2D tex, vec2 coord)
{
@narate
narate / create-hotspot.md
Last active June 10, 2025 13:59
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post : https://unix.stackexchange.com/a/310699

nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
@cyberang3l
cyberang3l / How to setup VirtualGL and TurboVNC on Ubuntu.md
Last active April 6, 2025 04:07
Setup VirtualGL and TurboVNC on Ubuntu for OpenGL forwarding