Skip to content

Instantly share code, notes, and snippets.

View divanvisagie's full-sized avatar
🦀
Rewriting it in Rust

Divan Visagie divanvisagie

🦀
Rewriting it in Rust
View GitHub Profile
function findDiff(original, newText) {
function getZip(originalList, newTextList){
return originalList.map(function(char,i) {
return {
first: char,
second: newTextList[i]
}
})
}
@divanvisagie
divanvisagie / build.gradle
Created October 7, 2015 07:32 — forked from anonymous/build.gradle
build.gradle for scala Flatspec project
apply plugin: "scala"
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.github.maiflai:gradle-scalatest:0.10"
@divanvisagie
divanvisagie / LCD.md
Last active August 29, 2015 14:11 — forked from DylanKnevitt/LCD.md

The LCD class constructs an object that represents an LCD Display.

Parameters

  • options An object of property parameters
Property Name Type

The LCD class constructs an object that represents an LCD Display.

Parameters

  • options An object of property parameters
Type
Property Name
// Bot DM script
sv_cheats 1
alias "money" "impulse 101"
alias "ammo" "givecurrentammo"
alias "infinite" "infiniteon"
alias "infiniteon" "bind mouse1 "+fireinfinite"; alias infinite infiniteoff"
var testArr = ['a','a','b','c','d'];
var numArr = [1,1,2,3,4,4];
var objArr = [{},{},{test:0},{test:5},{test:0}];
function unique( arr ){
var tmp = {};
var key;
for(var i=0; i < arr.length; i++){
/* HC-SR04 Sensor
https://www.dealextreme.com/p/hc-sr04-ultrasonic-sensor-distance-measuring-module-133696
This sketch reads a HC-SR04 ultrasonic rangefinder and returns the
distance to the closest object in range. To do this, it sends a pulse
to the sensor to initiate a reading, then listens for a pulse
to return. The length of the returning pulse is proportional to
the distance of the object from the sensor.
The circuit:

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@divanvisagie
divanvisagie / readme.md
Created January 4, 2013 12:32 — forked from coolaj86/how-to-publish-to-npm.md
A guide to publishing npm packages

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser