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
// Backbone.Wreqr (Backbone.Marionette) | |
// ---------------------------------- | |
// v1.3.1 | |
// | |
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC. | |
// Distributed under MIT license | |
// | |
// http://github.com/marionettejs/backbone.wreqr | |
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 assert = require('assert'); | |
var check = function(num) { | |
var numStr = String(num); | |
var length = numStr.length / 2; | |
for(var i = 0; i <= length; i++) { | |
if (numStr[i] != numStr[numStr.length - i - 1]) { | |
return false; | |
} | |
} |
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
- name: Machine with mongodb 3 | |
hosts: all | |
sudo: True | |
tasks: | |
- name: set locale | |
lineinfile: dest=/etc/default/locale line="LC_ALL=C" | |
- name: Add mongo ppa key | |
apt_key: > | |
keyserver=hkp://keyserver.ubuntu.com:80 |
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
from django.core.management.base import BaseCommand | |
from core import choices, models, utils | |
MARKER = 'test_data' | |
class Command(BaseCommand): | |
args = 'filename' |
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 rotations(num): | |
str_num = str(num) | |
result = set() | |
for mid in xrange(len(str_num)): | |
result.add( | |
str_num[mid:] + str_num[:mid] | |
) | |
return result |
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
.phony: check | |
check1: | |
curl -v http://develop.cricketduel.inprogress.rocks/ | |
check2: | |
curl -i http://develop.cricketduel.inprogress.rocks/ | |
t: |
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
class N | |
constructor: (val, next) -> | |
@val = val | |
@next = next | |
assert = require('assert') | |
reverse = (node, prev) => | |
if not node? | |
assert(prev?) |
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
# now you don't need to use curl | |
tasks: | |
- apt_key: | |
url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" | |
# change trusty for your distributive name | |
- apt_repository: repo="deb https://deb.nodesource.com/node_5.x trusty main" state=present |
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
# -*- mode: yaml-*- | |
# vi: set ft=yaml sw=2 ts=2 : | |
- name: Configure scala study machine | |
hosts: all | |
sudo: True | |
vars: | |
pg_version: 9.4 | |
pg_conf: "/etc/postgresql/{{ pg_version }}/main/postgresql.conf" | |
pg_hba: "/etc/postgresql/{{ pg_version }}/main/pg_hba.conf" |
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
const request = require('superagent'); | |
const _ = require('lodash'); | |
const H = require('highland'); | |
const Promise = require('bluebird'); | |
function getLocations() { | |
const call = request | |
.get('http://viatorapi.viator.com/service/taxonomy/locations') | |
.query({apiKey: API_KEY}) | |
return Promise.resolve(call) | |
.then((res) => res.body.data) |
OlderNewer