Skip to content

Instantly share code, notes, and snippets.

//
// This sketch will print some of interesting predefined constants to Serial.
//
// For more information, look at
// http://electronics4dogs.blogspot.com/2011/01/arduino-predefined-constants.html
// helper macro
#define LINE(name,val) Serial.print(name); Serial.print("\t"); Serial.println(val);
void setup()
Function::define = (prop, desc) ->
Object.defineProperty this.prototype, prop, desc
class GetterSetterTest
constructor: (@_obj = {}) ->
# 'obj' is defined via the prototype, the definition proxied through
# to 'Object.defineProperty' via a function called 'define' providing
# some nice syntactic sugar. Remember, the value of '@' is
# GetterSetterTest itself when used in the body of it's class definition.
@DomiR
DomiR / Beep.online.sh
Created June 1, 2014 20:53
Beep when online again.
beepwhenup () {
echo 'Enter host you want to ping:'; read PHOST;
if [[ "$PHOST" == "" ]];
then exit; fi;
while true;
do ping -c1 -W2 $PHOST 2>&1 >/dev/null;
if [[ "$?" == "0" ]];
then for j in $(seq 1 4);
do beep;
@DomiR
DomiR / Angular Object Filter.js
Created May 14, 2014 07:26
Order by object field.
yourApp.filter('orderObjectBy', function() {
return function(items, field, reverse) {
var filtered = [];
angular.forEach(items, function(item) {
filtered.push(item);
});
filtered.sort(function (a, b) {
return (a[field] > b[field] ? 1 : -1);
});
if(reverse) filtered.reverse();
@DomiR
DomiR / GitHelpers.md
Last active June 27, 2017 11:50
Git helpers

Git: how to merge my local, working changes into another branch

Since your files are not yet committed in branch1:

git stash
git checkout branch2
git stash pop

or

@DomiR
DomiR / vimcheat.md
Last active August 29, 2015 13:56
Vim Cheat Sheet

Code folding

Some common key bindings:

za - toggles

zc - closes

zo - opens

Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.

As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
    

brew install openconnect

@DomiR
DomiR / Iphone.md
Last active October 22, 2021 00:05
Iphone passwordless ssh

Passwordless SSH

If you have no own key in ~/.ssh/ calld id_rsa.pub then create one:

ssh-keygen -t rsa

Copy the public file to the iphone

@DomiR
DomiR / manual
Created January 8, 2014 09:30
Uni Stuttgart VPN
1. Install openconnect via
sudo brew install openconnect
2. Install tuntap
sudo brew install tuntap
-> add to startup
3. Install some kind of script executor on wlan change
run vpn-script with credentials
@DomiR
DomiR / install.opencv.readme.md
Last active January 1, 2016 00:49
How to install opencv on Mavericks