Skip to content

Instantly share code, notes, and snippets.

View proycon's full-sized avatar

Maarten van Gompel proycon

View GitHub Profile
curl -i -u YOURUSER -X GET https://api.github.com/repos/ORG/REPO/hooks
curl -i -u YOURUSER -X PATCH https://api.github.com/repos/ORG/REPO/hooks/IRC_HOOK_ID -d "{ \"add_events\": [\"push\", \"pull_request\", \"issues\"] }"
@proycon
proycon / lamblinsNearestNeighbors.py
Last active June 9, 2017 22:36 — forked from danielvarga/lamblinsNearestNeighbors.py
Theano code to find nearest neighbors to a set of vectors
# Implementing lamblin's workaround at https://github.com/Theano/Theano/issues/1399
# BEFORE:
# bestIndices = T.argmin(s, axis=0)
# Time in Function.fn.__call__: 3.870916e-02s (99.867%)
# <% time> <sum %> <apply time> <time per call> <type> <#call> <#apply> <Class name>
# 77.7% 77.7% 0.029s 2.93e-02s C 1 1 theano.tensor.basic.MaxAndArgmax
# 7.0% 84.7% 0.003s 2.64e-03s C 1 1 theano.sandbox.cuda.basic_ops.HostFromGpu
# 6.9% 91.6% 0.003s 1.30e-03s C 2 2 theano.sandbox.cuda.basic_ops.GpuFromHost
# 6.2% 97.8% 0.002s 2.35e-03s C 1 1 theano.sandbox.cuda.blas.GpuDot22Scalar
@proycon
proycon / ca
Last active August 19, 2019 22:27 — forked from naiaden/ca
info over ssh scripts
#!/bin/bash
green='\033[1;92m'
yellow='\033[1;93m'
red='\033[1;91m'
blue='\033[1;31m' #"\033[1;96m"
normal='\033[0m'
if [ -z "$PONY" ]; then
@proycon
proycon / parent_child_mp_reduction
Last active August 29, 2015 14:26 — forked from sunilmallya/parent_child_mp_reduction
multiprocessing.reduction socket server with parent processing passing connections to client after accepting connections
#!/usr/bin/env python
"""
@author Sunil Mallya
Sample code to show a parent - child like process communication model where parent listens on a port and passes the pickled file descriptor
to the child process to read the bytes off the socket. The communication in this snippet is via a Queue which is thread/process safe
Just to be clear, the parent process is still accepting the connection and we are sending a live fd to the child
"""
import os
import sys