Skip to content

Instantly share code, notes, and snippets.

View werelax's full-sized avatar

Elías Alonso werelax

View GitHub Profile

Epub Tutorial

Pre-requisite

Creating eBooks in the EPUB format

Listing 1. Directory and file layout for a simple EPUB archive (EPUB 2 file structure )

@werelax
werelax / local_through_server.sh
Last active July 21, 2016 11:24
Forward and Reverse SSH Tunnels
# Map a local port to a target port through the remote server.
# In the example: localhost:9000 is tunneled to imgur.com:80 through example.com
# local:9000 -> exaple.com -> target:80
# you could browse to http://localhost:9000/ and browse imgur.com
# (won't see anything, because imgur has changed their stack, but the tunnel works)
ssh -L 9000:imgur.com:80 user@example.com
# Useful for: use a server as a proxy, secure a connection (ssh encrypts everything),
@mhitza
mhitza / Makefile
Last active June 4, 2024 00:37
Programming Arduino Uno (ATmega386P) in assembly
%.hex: %.asm
avra -fI $<
rm *.eep.hex *.obj *.cof
all: $(patsubst %.asm,%.hex,$(wildcard *.asm))
upload: ${program}.hex
avrdude -c arduino -p m328p -P /dev/arduino-uno -b 115200 -U flash:w:$<
monitor:
@laziel
laziel / unlock.js
Created September 18, 2015 09:02
Unlock Web Audio in iOS 9 Safari
var ctx = null, usingWebAudio = true;
try {
if (typeof AudioContext !== 'undefined') {
ctx = new AudioContext();
} else if (typeof webkitAudioContext !== 'undefined') {
ctx = new webkitAudioContext();
} else {
usingWebAudio = false;
}
@cosmez
cosmez / gist:9f58c03b719210ce65e8
Last active April 5, 2017 17:33
Racket Public FFI Examples
taglib https://github.com/takikawa/taglib-racket/blob/master/taglib/taglib.rkt
libsdl http://planet.racket-lang.org/package-source/pb82/sdl4racket.plt/1/1/src/
allegro https://github.com/kazzmir/racket-allegro-5/blob/master/allegro.rkt
libgit2 https://github.com/jarnaldich/racket-git/blob/master/libgit2.rkt
opencl http://planet.racket-lang.org/package-source/jaymccarthy/opencl.plt/3/4/c/
openmpi http://planet.racket-lang.org/package-source/jaymccarthy/openmpi.plt/1/1/ffi/
zeroqm http://planet.racket-lang.org/package-source/jaymccarthy/zeromq.plt/2/1/zmq.rkt
svn http://planet.racket-lang.org/package-source/jaymccarthy/svn-prop.plt/1/0/main.ss
chipmunk http://planet.racket-lang.org/package-source/jaymccarthy/chipmunk.plt/1/0/chipmunk-ffi.ss
opencv https://github.com/oetr/racket-opencv
@shortsightedsid
shortsightedsid / cl-tcpip.lisp
Last active January 15, 2024 02:36
Short guide to TCP/IP Client/Server programming in Common Lisp using usockets
; Short guide to TCP/IP Client/Server programming in Common Lisp using usockets
;
; The main reason for this guide is because there are very few examples that
; explain how to get started with socket programming with Common Lisp that I
; could understand. After spending a day trying, I finally came up with a small
; bit of code that makes it easy to understand the basics. I've written this
; primarily for myself, but should help others get started as well.
; As usual, we will use quicklisp to load usocket.
@john2x
john2x / 00_destructuring.md
Last active June 6, 2024 13:40
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@sudara
sudara / Github-style-syntax-in-pages.md
Last active December 31, 2020 02:49
Github style syntax highlighting in Pages.app

I like Pages.app, but don't want to deal with constantly copying and pasting code around.

Here is how I do syntax highlighting in Pages.app by pressing a key command. It's based off of this post on stack exchange.

install pygments

sudo easy_install Pygments

install github syntax

@branneman
branneman / better-nodejs-require-paths.md
Last active June 12, 2024 02:40
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@satooshi
satooshi / DirectoryStructure
Last active September 26, 2021 20:03
Directory structure of Domain Driven Design application with Symfony2, Doctrine2.
sf2-ddd
├── app
├── bin
├── build
├── lib
├── src
│   └── __VendorPrefix
│   ├── Application
│   │   └── __DomainNameBundle
│   │   ├── Command