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
CREATE KEYSPACE c4476 WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; | |
USE c4476; | |
CREATE TABLE users ( | |
userid uuid, | |
age int, | |
firstname text, | |
lastname text, | |
PRIMARY KEY (userid) |
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
#!/bin/bash | |
WHAT=${1:-ngrok} | |
if [ hash ${WHAT} 2>/dev/null ]; then | |
echo original found ${WHAT} | |
else | |
echo original failed ${WHAT} | |
fi |
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/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
def try_to(text): | |
try: | |
after = text.encode('ascii') | |
except UnicodeEncodeError: | |
after = text.encode('utf-8') | |
except UnicodeDecodeError: |
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
--- i/src/mcash/mcash/core/person/api/v1/handlers/addressbook.py | |
+++ w/src/mcash/mcash/core/person/api/v1/handlers/addressbook.py | |
@@ -202,7 +202,7 @@ class AddressBookHandler(BasePersonHandler): | |
raise ndb.Return(filter(None, res)) | |
@secure(level=AuthLevel.TWOFACTOR) | |
- @schemas(input_form=forms.AddressBookRequestForm, output_form=forms.AddressBookResponseForm, validate_input=True) | |
+ @schemas(input_form=forms.AddressBookRequestForm, output_form=None, validate_input=True) | |
@ndb.tasklet | |
def get(self, *args, **kwargs): |
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
diff --git i/viewstart/viewstart.service w/viewstart/viewstart.service | |
index f6cd660..c2c0fc0 100644 | |
--- i/viewstart/viewstart.service | |
+++ w/viewstart/viewstart.service | |
@@ -13,6 +13,7 @@ ExecStartPre=/bin/sh -c 'docker ps -a | grep ${NAME} > /dev/null; if [ $? -eq 0 | |
ExecStart=/usr/bin/docker run --name ${NAME} -v /src:/src -v /input:/input ${IMAGE} | |
ExecStop=/bin/sh -c 'docker ps | grep ${NAME} > /dev/null; if [ $? -eq 0 ] ; then docker stop ${NAME} ; fi' | |
ExecStopPost=/bin/sh -c 'docker ps -a | grep ${NAME} > /dev/null; if [ $? -eq 0 ] ; then docker rm ${NAME} ; fi' | |
+ExecStopPost=/usr/bin/sudo /usr/sbin/poweroff |
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: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/vivid64" | |
config.vm.network "forwarded_port", guest: 2375, host: 2375, auto_correct: true | |
config.vm.network :private_network, ip: "172.17.8.100" | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = 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
(ns pw.bot | |
(:gen-class :main true :prefix "-") | |
(:use [clojure.string :only (trim split-lines)] | |
pw.planetwars)) | |
;; Helpers for your bot | |
(defn my-strongest-planet | |
[pw] | |
((first (sort-by #(> (:num-ships %1) (:num-ships %2)) | |
(my-planets pw))) :planet-id)) |
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/env python | |
import datetime | |
import tornado.auth | |
import tornado.httpserver | |
import tornado.web | |
class LoginHandler(tornado.web.RequestHandler): | |
def get_current_user(self): | |
return self.get_secure_cookie("user") |
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
babo@attila% find /apps/ocaml -name ocamlbuild\* | |
/apps/ocaml/bin/ocamlbuild | |
/apps/ocaml/bin/ocamlbuild.byte | |
/apps/ocaml/lib/ocaml/ocamlbuild | |
/apps/ocaml/lib/ocaml/ocamlbuild/ocamlbuild.cmo | |
/apps/ocaml/lib/ocaml/ocamlbuild/ocamlbuild_executor.cmi | |
/apps/ocaml/lib/ocaml/ocamlbuild/ocamlbuild_executor.cmo | |
/apps/ocaml/lib/ocaml/ocamlbuild/ocamlbuild_executor.cmx | |
/apps/ocaml/lib/ocaml/ocamlbuild/ocamlbuild_executor.o | |
/apps/ocaml/lib/ocaml/ocamlbuild/ocamlbuild_pack.cmi |
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
import riak | |
def f(n=100): | |
client = riak.client.RiakClient() | |
b = client.bucket('ize') | |
for i in xrange(n): | |
try: | |
k = b.new_binary(str(i), str(i)) | |
x = k.store(w=3, dw=1) |
OlderNewer