Skip to content

Instantly share code, notes, and snippets.

View vvzen's full-sized avatar
🎥
Pipeline Developer

Valerio Viperino vvzen

🎥
Pipeline Developer
View GitHub Profile
@voidtuxic
voidtuxic / metronome.cs
Created December 19, 2013 11:23
C# Metronome for Unity3D
using UnityEngine;
using System.Collections;
public delegate void MetronomeEvent(Metronome metronome);
public class Metronome : MonoBehaviour {
public int Base;
public int Step;
public float BPM;
public int CurrentStep = 1;
@victorreyesh
victorreyesh / Aircrack Commands
Created September 12, 2013 03:36
Cracking WPA2 / WEP Wifi / Aircrack 10 seconds guide. For Mac OSX
//Install Macports.
//Install aircrack-ng:
sudo port install aircrack-ng
//Install the latest Xcode, with the Command Line Tools.
//Create the following symlink:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
//Figure out which channel you need to sniff:
sudo airport -s
sudo airport en1 sniff [CHANNEL]
@Integralist
Integralist / regex.js
Created March 11, 2013 15:15
The difference between JavaScript's `exec` and `match` methods is subtle but important, and I always forget...
var str = "The quick brown fox jumped over the box like an ox with a sox in its mouth";
str.match(/\w(ox)/g); // ["fox", "box", "sox"]
// match (when used with a 'g' flag) returns an Array with all matches found
// if you don't use the 'g' flag then it acts the same as the 'exec' method.
str.match(/\w(ox)/); // ["fox", "ox"]
/\w(ox)/.exec(str); // ["fox", "ox"]
@osdrv
osdrv / mercator.cpp
Created December 30, 2011 08:38
c++ libcinder mercator coordinates mapper
#include "Mercator.h"
#include "cinder/app/AppBasic.h"
#include "cinder/Vector.h"
using namespace ci;
using namespace std;
/* static method to map latitude and longitude to mercator 2d coords */
Vec2f Mercator::mapLatLon( const Vec2f lat_lon ) {
/* mercator projection center was screen centered */
Vec2f offset = Vec2f( app::getWindowWidth() / 2, app::getWindowHeight() / 2 );
@nowl
nowl / perlin.lisp
Created February 16, 2011 01:55
Perlin Noise in Common Lisp (slightly optimized)
(defpackage #:perlin
(:use #:cl)
(:export #:perlin2d
#:*seed*))
(in-package #:perlin)
(declaim (optimize (speed 3) (safety 0) (debug 0)))
(defparameter *seed* 0)