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
/** | |
* Programmer's Oath by Robert C. Martin | |
* http://blog.cleancoder.com/uncle-bob/2015/11/18/TheProgrammersOath.html | |
*/ | |
val PREAMBLE = """ | |
In order to defend and preserve the honor of the profession of computer programmers, | |
I Promise that, to the best of my ability and judgement: | |
""" |
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 | |
echo "$1" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"' |
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 | |
# | |
# Send adb commands to all connected devices. | |
# | |
# Usage: adb-all COMMANDS | |
# | |
adb devices | tail -n +2 | cut -sf 1 | xargs -I {} adb -s {} $@ |
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
* { | |
background-color: transparent; | |
} | |
.print-only { | |
display: none; | |
} | |
@media print { | |
html,body { |
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
ffmpeg -y -i input.mov -c:v h264 -preset medium -b:v 1800k -pass 1 -c:a libvo_aacenc -b:a 128k -f mp4 /dev/null && \ | |
ffmpeg -i input.mov -c:v h264 -preset medium -b:v 1800k -pass 2 -c:a libvo_aacenc -b:a 128k output.mp4 |
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('myApp', []); | |
angular.module('myApp').controller('watcherCtrl', ['$scope', function($scope) { | |
$scope.myArray = []; | |
var index = 42; | |
$scope.push = function () { | |
$scope.myArray.push(index++); | |
} | |
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
// Created by: Szotyori Alpar | |
// Spent time: 15.03.2014 - 5 hrs | |
// Spent time: 16.03.2014 - 3 hrs | |
var DEBUG = true; | |
// JS loader function from: http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml | |
function loadjscssfile(filename){ | |
var fileref=document.createElement('script') | |
fileref.setAttribute("type","text/javascript") |
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
// You need log4javascript for the logging to work | |
// Or use the console, if log4javascript is not available | |
if (typeof log !== 'Object') { | |
log = { | |
debug: function (message) { | |
console.log(message); | |
} | |
} | |
} |
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
Array.prototype.deleteFromIndex = function(index) { | |
return this.splice(index,array.length-index); | |
} | |
var array = ["Apple","Turtle","Microsoft","Atari","John","Carter","HTC"]; | |
var array2 = array.deleteFromIndex(2); | |
console.log(array); | |
console.log(array2); |
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
var value = -50; | |
var max = 0; | |
var min = -30; | |
var result = value; | |
if (result >= max) { | |
result = max; | |
} else if (result < min) { | |
result = min; | |
} | |
console.log('result with ifs: ' + result); |
NewerOlder