This file contains 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
(def pack []) | |
;try to avoid this | |
(if (not (empty? pack)) (print "something") (print "empty")) | |
;in favor of this | |
(if (seq pack) (print "something") (print "empty")) |
This file contains 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
$ for dir in *; do echo $dir ; done; |
This file contains 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 Robot = function(robot) { | |
}; | |
var firstTime = true; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
var moveAhead = Math.floor(Math.random()*101); | |
robot.ahead(moveAhead); |
This file contains 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('twitter') | |
.factory('theirTwitterFactory', function($http){ | |
var factory = {}; | |
$http.get('/data/theirs.json') | |
.success(function(data, status, headers, config) { | |
factory.tweets = data; | |
}); | |
return { | |
tweets: function(){ |
This file contains 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
cd / && sudo du -aH --max-depth=1 |
This file contains 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
/usr/bin/Xvfb :99 -ac -screen 0 1024x768x16 |
This file contains 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
<!doctype html> | |
<html ng-app="myApp"> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js"></script> | |
</head> | |
<body> | |
<div ng-controller="TodoCtrl"> | |
<button ng-click="beQuickOrBeDead()">Fetch with 100ms timeout</button> | |
<button ng-click="neverEndingStory()">Fetch with default timeout</button> |
This file contains 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
//my initial config | |
app.config(["$routeProvider", function($routeProvider){ | |
$routeProvider | |
.when('/list_streams', { | |
templateUrl: 'assets/angular/views/target_bitrates.html', | |
controller: 'TargetBitratesCtrl' | |
}) | |
.when('/transmissions',{ | |
templateUrl: 'assets/angular/views/create_live_media.html', |
This file contains 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('Sauron') | |
.factory('TargetBitrates', ["$http", "$timeout", "Config", function($http, $timeout, Config){ | |
var data = {list: []}; | |
var onSuccess = function(result){ | |
data.list = result.data.data; | |
$timeout(poller, Config.pollingTimeout); | |
}; | |
var poller = function() { | |
$http.get('/streams.json', Config.httpOptions).then(onSuccess); | |
}; |
This file contains 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('pearlJam') | |
.factory('Songs', function($http, $timeout, Config){ | |
var response = {list: []}; | |
var onSuccess = function(result){ | |
response.list = result.data.data; | |
$timeout(poller, Config.pollingTimeout); | |
}; | |
var poller = function(){ | |
$http.get('api/songs.json', Config.httpOptions).then(onSuccess); |
OlderNewer