Skip to content

Instantly share code, notes, and snippets.

View genoma's full-sized avatar

Alessandro Vioni genoma

View GitHub Profile
@genoma
genoma / smart-resize.coffee
Created April 7, 2014 15:48
Debouncing function for jQuery .resize() in Coffeescript
## http://www.paulirish.com/2009/throttled-smartresize-jquery-event-handler/
## ---------------------------------------------
## debouncing function from John Hann
## http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
#
# (function($,sr){
# var debounce = function (func, threshold, execAsap) {
# var timeout;
# return function debounced () {
# var obj = this, args = arguments;
@genoma
genoma / launch.sh
Created July 15, 2014 15:26
Script to use pageres
#!/bin/bash
echo ""
echo -n "$(tput setaf 1)What script you'd like to launch? $(tput bold)[C = Cropped/N = Normal] $(tput sgr 0)"
read script
if [ "$script" = "n" ]; then
cat resolutions|pageres localhost:3000
else
cat resolutions|pageres localhost:3000 -c
@genoma
genoma / view.coffee
Created September 10, 2014 14:23
Element is on view, return false, true
isScrolledIntoView = (elem) ->
docViewTop = $(window).scrollTop()
docViewBottom = docViewTop + $(window).height()
elemTop = $(elem).offset().top
elemBottom = elemTop + $(elem).height()
(elemBottom - 200 < docViewBottom) and (elemBottom + $(elem).height() > docViewBottom )
// *****************************************************************
// DEPENDENCIES
import fs from 'fs';
import path from 'path';
import gulp from 'gulp';
let use = taskname => require(`./tasks/gulp.${taskname}`);
let createTask = elem => gulp.task.apply(gulp, elem);
@genoma
genoma / add.ovpn.configuration
Last active May 7, 2017 11:43
AirVpn configuration for OSX
# add it before the <ca> around line 20
# of your downloaded ovpn file
script-security 2
up "/users/{home}/connect.sh"
down "/users/{home}/disconnect.sh"
@genoma
genoma / README.md
Last active January 21, 2026 22:55
Build OpenVPN on MacOSX

Basic steps to compile OpenVPN with LibreSSL or OpenSSL

Clone the OpenVPN repository (master or checkout a TAG to build stable release)

$ git clone https://github.com/OpenVPN/openvpn.git

Install dependencies with HOMEBREW

$ brew install automake autoconf libtool pkg-config libressl openssl lzo lz4