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
Moved to https://github.com/sudowork/fix_m1_rgb |
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
import Ember from 'ember'; | |
const { | |
computed, | |
get, | |
} = Ember; | |
export default Ember.Controller.extend({ | |
todos: computed('model', 'model.todos.[]', function() { | |
return get(this, 'model.todos'); |
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
// Adapted from https://github.com/paralect/robomongo/issues/348#issuecomment-38069899 | |
var toCSV = function(data, options){ | |
var headers = []; | |
var records = []; | |
var line; | |
var response = ''; | |
var i, l = data.length, rl=0, j, k; | |
var reReplaceTextDelim; | |
var processRecord = function(src, rec, prefix){ | |
var key, val, idx; |
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
#!/usr/bin/env bash | |
# You must have sudo ability on your machine | |
machine=${1:-"default"} | |
if [[ ! $(docker-machine ls | grep ${machine}) ]]; then | |
echo "${machine} is not a docker-machine" | |
exit 1 | |
fi |
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
#!/usr/bin/env bash | |
# You must have sudo ability on your machine | |
machine=${1:-"default"} | |
if [[ ! $(docker-machine ls | grep ${machine}) ]]; then | |
echo "${machine} is not a docker-machine" | |
exit 1 | |
fi |
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
<?xml version="1.0"?> | |
<root> | |
<devicevendordef> | |
<vendorname>YUBICO</vendorname> | |
<vendorid>0x1050</vendorid> | |
</devicevendordef> | |
<deviceproductdef> | |
<productname>YUBIKEY_II</productname> |
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
require('npm').load(function (err, npm) { | |
npm.commands.ls([], true, function (err, data, lite) { | |
// log the version of express | |
console.log(lite.dependencies.express.version); | |
}) | |
}); |
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
/* sites.js */ | |
var | |
mongoose = require('mongoose') | |
, Schema = mongoose.Schema | |
, update = require('./updates') | |
; | |
//Define the site model | |
var siteSchema = new Schema({ | |
client: String, |
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 list comprehension to get a list of chess squares | |
user=> (for [x (range 1 9), y (range 1 9)] [x y]) | |
([1 1] [1 2] [1 3] [1 4] [1 5] [1 6] [1 7] [1 8] [2 1] [2 2] [2 3] [2 4] [2 5] [2 6] [2 7] [2 8] [3 1] [3 2] [3 3] [3 4] [3 5] [3 6] [3 7] [3 8] [4 1] [4 2] [4 3] [4 4] [4 5] [4 6] [4 7] [4 8] [5 1] [5 2] [5 3] [5 4] [5 5] [5 6] [5 7] [5 8] [6 1] [6 2] [6 3] [6 4] [6 5] [6 6] [6 7] [6 8] [7 1] [7 2] [7 3] [7 4] [7 5] [7 6] [7 7] [7 8] [8 1] [8 2] [8 3] [8 4] [8 5] [8 6] [8 7] [8 8]) | |
; apply a filter using the :when keyword | |
user=> (for [x (range 1 9), y (range 1 9), :when (= x y)] [x y]) | |
([1 1] [2 2] [3 3] [4 4] [5 5] [6 6] [7 7] [8 8]) |
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
; NON-tail recursive version of size | |
; because the recursive call must be returned to the caller | |
(defn non-tail-size [v] | |
(if (empty? v) | |
0 | |
(inc (non-tail-size (rest v))))) | |
user=> (non-tail-size [1 2 3]) | |
3 | |
user=> (non-tail-size (range 10000)) | |
StackOverflowError clojure.core/range/fn--4269 (core.clj:2664) |
NewerOlder