Skip to content

Instantly share code, notes, and snippets.

View remram44's full-sized avatar

Remi Rampin remram44

View GitHub Profile
@remram44
remram44 / test.jl
Last active August 29, 2015 14:03
Translation of PyQt code at https://gist.github.com/remram44/9643396 to Julia
using PyCall
@pyimport sys
@pyimport sip
# Complicated stuff
api2_classes = [
"QData", "QDateTime", "QString", "QTextStream",
"QTime", "QUrl", "QVariant"]
for cl = api2_classes
@remram44
remram44 / ipython-script.py
Created July 22, 2014 22:00
ipython-script.py
#!C:\Python2.7\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'ipython==2.1.0','console_scripts','ipython'
__requires__ = 'ipython==2.1.0'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('ipython==2.1.0', 'console_scripts', 'ipython')()
)
@remram44
remram44 / twistedconsole.py
Created August 20, 2014 03:21
Version of Twisted StandardIO that actually works on Windows
import sys
from twisted.internet import interfaces, reactor
from twisted.python.runtime import platform
from zope.interface import implements
# Adapted from paramiko demo code
# Original note: thanks to Mike Looijmans for this code
class WindowsIO(object):
implements(interfaces.ITransport)
@remram44
remram44 / Vagrantfile
Last active August 29, 2015 14:08
Torque on Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "master", primary: true do |m|
m.vm.box = "remram/debian-7-amd64"
m.vm.network "private_network", ip: "10.4.8.11"
m.vm.provider "virtualbox" do |v|
@remram44
remram44 / makecerts.sh
Last active August 29, 2015 14:08
Tests requests with custom certificates
#!/bin/sh
set -e
ca_conf='
[ ca ]
default_ca = ca_default
[ ca_default ]
dir = ./
@remram44
remram44 / rémi
Last active August 29, 2015 14:11
Bro, do you even clone?
NOPE HAHA
{
"metadata": {
"name": "",
"signature": "sha256:82b14ec273a20467370c8840073bdf9397837b301b2a1e1648900aadf100c39f"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
set(what "RESULT_VARIABLE")
execute_process(COMMAND echo ${what})
$ echo hello | hexdump -v -e "\"\\x\" 1/1 \"%02X\""
x68x65x6Cx6Cx6Fx0A
$ echo hello | hexdump -v -e "\"\\\\x\" 1/1 \"%02X\""
\\68\\65\\6C\\6C\\6F\\0A
expected: \x68\x65\x6C\x6C\x6F\x0A
$ echo hello | hexdump -v -e "1/1 \"\\x%02X\""
hexdump: %A: bad conversion character
@remram44
remram44 / .gitignore
Last active August 29, 2015 14:14
Class generation timing, dynamic vs generated Python
*.py[co]
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin