Skip to content

Instantly share code, notes, and snippets.

View gourneau's full-sized avatar
🎯
Focusing

Joshua Gourneau gourneau

🎯
Focusing
View GitHub Profile
@gourneau
gourneau / keepers.py
Created April 7, 2014 22:45
Ion Torrent: Use REST API to change experiment storage_options based on result PK
import requests
from requests.auth import HTTPBasicAuth
import json
import sys
server = "http://fall.local"
auth = HTTPBasicAuth('username', 'password')
#get this from somewhere else, this is just an example , maybe from sys.argv[1]
@gourneau
gourneau / designer.html
Created October 24, 2014 22:06
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@gourneau
gourneau / gist:798087d821458a4d62e5
Created January 29, 2015 02:10
pyzqm ironpython install error
C:\Documents and Settings\Synthego\My Documents\Downloads\pyzmq-ironpython-backend\pyzmq-ironpython-backend>ipy setup.py install --user
running configure
Found zmq at: C:\Program Files\ZeroMQ 4.0.4
************************************************
Configure: Autodetecting ZMQ settings...
Custom ZMQ dir: C:\Program Files\ZeroMQ 4.0.4
error: IronPython.Runtime.Exceptions.OSException: cannot load library C:\Program Files\ZeroMQ 4.0.4\bin\libzmq-v110-mt-4_0_4.dll
at IronPython.Modules.CTypes.LoadLibrary(String library, Int32 mode)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`3.Run(InterpretedFrame frame)
@gourneau
gourneau / gist:f097f98af0c813456603
Created January 29, 2015 02:30
pyzmq ironpython install
C:\Documents and Settings\Synthego\My Documents\Downloads\pyzmq-ironpython-backend\pyzmq-ironpython-backend>ipy -X:FullFrames setup.py install --user
running configure
Found zmq at: C:\Program Files\ZeroMQ 4.0.3
************************************************
Configure: Autodetecting ZMQ settings...
Custom ZMQ dir: C:\Program Files\ZeroMQ 4.0.3
ZMQ version detected: 4.0.3
Warning: Detected ZMQ version: 4.0.3, but pyzmq targets ZMQ 4.0.4.
Warning: libzmq features and fixes introduced after 4.0.3 will be unavailable.
************************************************
@gourneau
gourneau / gist:12b2813cbb00a673f837
Created March 7, 2015 04:28
synthesize install log
synthego@graphs:~/synthesize$ sudo ./install
[sudo] password for synthego:
+++ dirname ./install
++ cd .
++ pwd
+ SYNTHESIZE_HOME=/home/synthego/synthesize
++ cut -s -f 2
++ grep '^Descrip'
++ lsb_release -a
+ UBUNTU_RELEASE='Ubuntu 14.04.2 LTS'
root@backbone:/etc# pip uninstall shinken
Uninstalling Shinken-2.4:
/usr/local/lib/python2.7/dist-packages/Shinken-2.4.dist-info/DESCRIPTION.rst
/usr/local/lib/python2.7/dist-packages/Shinken-2.4.dist-info/METADATA
/usr/local/lib/python2.7/dist-packages/Shinken-2.4.dist-info/RECORD
/usr/local/lib/python2.7/dist-packages/Shinken-2.4.dist-info/WHEEL
/usr/local/lib/python2.7/dist-packages/Shinken-2.4.dist-info/metadata.json
/usr/local/lib/python2.7/dist-packages/Shinken-2.4.dist-info/top_level.txt
/usr/local/lib/python2.7/dist-packages/etc/init.d/shinken
/usr/local/lib/python2.7/dist-packages/etc/init.d/shinken-arbiter
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
<html>
<body>
<script>
var myWebSocket = new WebSocket("ws://127.0.0.1:8080/ws/echo");
myWebSocket.onopen = function(evt) {
alert("Connection open ...");
};
myWebSocket.onmessage = function(evt) {
from twisted.internet import reactor
from twisted.web.websocket import WebSocketHandler, WebSocketResource
from twisted.web.server import Site
from twisted.web.static import File
class Echohandler(WebSocketHandler):
def frameReceived(self, frame):
self.sendFrame(frame)
@gourneau
gourneau / hosted-path.php
Created November 29, 2010 06:34
Find the full URL that a PHP script is running at , minus the name of the file
//Find the full url to the site we are at
$protocol = $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';
$address = $protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$currentFile = $_SERVER["SCRIPT_NAME"];
$parts = Explode('/', $currentFile);
$currentFile = $parts[count($parts) - 1];
$site_path = str_replace($currentFile,'',$address);