This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module("ui-utils.focus", ['ng']) | |
.directive('focusMe', function($log) { | |
return { | |
link: function(scope, element, attrs) { | |
scope.$watch(attrs.focusMe, function(value) { | |
if(value === true) { | |
$log.debug("value=" + element[0].value); | |
element[0].focus(); | |
scope[attrs.focusMe] = false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/io.h> | |
#include <avr/wdt.h> | |
#define RESET() wdt_enable(WDTO_30MS); while(1) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
// March 2014 - TMRh20 - Updated along with High Speed RF24 Library fork | |
// Parts derived from examples by J. Coliz <[email protected]> | |
*/ | |
/** | |
* Example for efficient call-response using ack-payloads | |
* | |
* This example continues to make use of all the normal functionality of the radios including | |
* the auto-ack and auto-retry features, but allows ack-payloads to be written optionlly as well. | |
* This allows very fast call-response communication, with the responding radio never having to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LOG_FILE=$1 | |
while : | |
do | |
temp=`/opt/vc/bin/vcgencmd measure_temp` | |
temp=${temp:5:16} | |
echo $(date '+%F %H:%M:%S') [$temp] >>LOG_FILE | |
sleep 10 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
exec 5>&1 | |
SHARE="/mnt/TORRENT/completed" | |
LOCAL="/media/STORAGE/@temp" | |
FILES="/media/STORAGE/@new" | |
TIMESTAMP="$(date '+%d %h %y %H:%M:%S')" | |
LOCK="rsync-completed.lock" | |
# acquire lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
trap '[ "$?" -eq 0 ] || read -p "Looks like something went wrong... Press any key to continue..."' EXIT | |
VM=default | |
DOCKER_MACHINE=./docker-machine.exe | |
export PATH="/c/Program Files/Docker Toolbox:$PATH" | |
export HTTP_PROXY=10.235.34.235:3129 | |
export HTTPS_PROXY=10.235.34.235:3129 | |
for n in $(docker-machine ls --format {{.Name}}); do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Elapsed.h> | |
#include <Effects.h> | |
#include <Qube.h> | |
#include <FormattingSerialDebug.h> | |
#define BUTTON_PIN 2 | |
#define SIZE 3 | |
const int pins[SIZE][SIZE] = { // | |
{ 3, 4, 5 }, // row 1 | |
{ 6, 7, 8 }, // row 2 |