$ sudo npm install cylon cylon-ble -g
$ npm install sphero noble
$ cylon-ble-scan
export GAEPATH=/your/path/for/google_appengine | |
export PATH=$PATH:$GAEPATH | |
export PATH=$WORKSPACE/venv/bin:/usr/local/bin:$PATH | |
export PYENV_HOME=$WORKSPACE/.pyenv/ | |
export PYTHONPATH=$PYTHONPATH:$GAEPATH | |
if [ -d $PYENV_HOME ]; then | |
rm -rf $PYENV_HOME | |
fi |
chmod +x ~/Library/Application\ Support/Steam/SteamApps/common/HacknSlash/Hack.app/Contents/MacOS/Hack |
import sys | |
def show_progress(actual, total): | |
percentage = actual / float(total) | |
done = int(50 * percentage) | |
sys.stdout.write("\r[%s%s] %d %%" % ('=' * done, ' ' * (50-done), percentage * 100)) | |
sys.stdout.flush() |
var app = angular.module('demo', ['textToSpeech']); | |
app.controller('demoCtrl', function($scope, $timeout, textToSpeech) { | |
textToSpeech.onVoiceReady(function(){ | |
textToSpeech.speak( | |
'You worked 9 hours!!', | |
'UK English Male', | |
{pitch: 2} | |
).then(function() { | |
alert('Finish!'); | |
}, function(err) { |
#include <Python.h> | |
static PyObject *sum(PyObject *self, PyObject *args) { | |
const long a, b; | |
if (!PyArg_ParseTuple(args, "LL", &a, &b)) | |
return NULL; | |
return PyLong_FromLong(a + b); | |
} | |
static PyMethodDef MathMethods[] = { |
from newmath import sum | |
print (sum(5,4)) |
package main | |
// #cgo pkg-config: python3 | |
// #include <Python.h> | |
// int PyArg_ParseTuple_LL(PyObject *, long long *, long long *); | |
import "C" | |
import ( | |
"fmt" | |
) |
#define Py_LIMITED_API | |
#include <Python.h> | |
int PyArg_ParseTuple_LL( | |
PyObject * args, | |
long long * a, | |
long long * b | |
) { | |
return PyArg_ParseTuple(args, "LL", a, b); | |
} |
#include <Python.h> | |
// ... | |
int is_a_long(PyObject * p) { | |
return PyLong_Check(p); | |
} |