Skip to content

Instantly share code, notes, and snippets.

View ElHacker's full-sized avatar
🥽

Braulio Chavez ElHacker

🥽
View GitHub Profile
@ElHacker
ElHacker / __init__.py
Last active March 15, 2018 09:11
Python-for-android opencv 3.4.1 Recipe
import os
import sh
from pythonforandroid.toolchain import (
NDKRecipe,
Recipe,
current_directory,
info,
shprint,
)
from multiprocessing import cpu_count
@ilya-t
ilya-t / GLTextureView.java
Last active May 16, 2024 12:18
TextureView implementation for displaying openGL rendering
import android.content.Context;
import android.graphics.SurfaceTexture;
import android.opengl.GLSurfaceView;
import android.opengl.GLUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.TextureView;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
@Adrian2112
Adrian2112 / higher-order-functions.rb
Created April 16, 2015 16:56
Higher order functions in ruby
list = (1..10).to_a
# a little monkey patching first so we have the rest method for array
class Array
# list with zero or more elements
# [].rest => []
# [1].rest => []
# [1,2,3].rest => [2,3]
def rest
_,*rest = *self
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 16, 2024 13:44
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@carsonmcdonald
carsonmcdonald / cupsprintofile.py
Last active July 29, 2018 06:13
Quick python script to print to a file with cups.
#!/usr/bin/python
# sudo lpadmin -p printer-name-here -E -v socket://localhost:12000 -m raw
import socket
fpsock = socket.socket()
fpsock.bind(('127.0.0.1', 12000))
fpsock.listen(5)
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net