Skip to content

Instantly share code, notes, and snippets.

@jlesquembre
jlesquembre / gist:9994132
Last active August 29, 2015 13:58
Descriptors pyug
{
"metadata": {
"celltoolbar": "Slideshow",
"name": "",
"signature": "sha256:b392c503122c5ac4b5ed7cb8d3ce0d2ba9fce4f4d8596d0ed399df0e06bc778a"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
@jlesquembre
jlesquembre / pew.PKGBUILD
Last active August 29, 2015 13:59
archlinux PKGBUILD for pew
# $Id$
# Maintainer: José Luis Lafuente <jl@lafuente.me>
# Contributor: Arthur Vuillard <arthur@hashbang.fr>
pkgname='python-pew'
pkgver=0.1.14
pkgrel=1
pkgdesc="Python Env Wrapper, a set of tools to manage multiple virtual environments"
url="https://github.com/berdario/pew"
arch=('any')
@jlesquembre
jlesquembre / keybase.md
Created October 8, 2014 09:34
keybase.md

Keybase proof

I hereby claim:

  • I am jlesquembre on github.
  • I am jlesquembre (https://keybase.io/jlesquembre) on keybase.
  • I have a public key whose fingerprint is 861E 4236 005A CB35 220D 8147 09AF B79F 061A CD6C

To claim this, I am signing this object:

@jlesquembre
jlesquembre / remoteadmin-build-debian.sh
Created October 19, 2011 13:53
Creates a Debian binary package for "Remote Admin"
#!/bin/sh
# Prepare folders for debian repository
FOLDER="debs/remoteadmin"
if [ -d "$FOLDER" ]; then
rm -rf $FOLDER
fi
mkdir -p $FOLDER
echo "remoteadmin optional misc" > $FOLDER/override
@jlesquembre
jlesquembre / remoteadmin-pre-debian.sh
Created October 19, 2011 13:38
Install the prerequisites to build "Remote Admin" in Debian
#!/bin/sh
echo "deb http://download.opensuse.org/repositories/home:/pgquiles:/Wt/Debian_6.0/ ./" >> /etc/apt/sources.list
echo "deb http://backports.debian.org/debian-backports squeeze-backports main" >> /etc/apt/sources.list
aptitude update
aptitude install witty git
aptitude -t squeeze-backports install cmake
@jlesquembre
jlesquembre / server.py
Created October 20, 2012 09:43
Serve static files and modify headers
from twisted.web.server import Site
from twisted.web.static import File
from twisted.internet import reactor
static_path = '/path/to/folder'
class ResponseFile(File):
def render(self, request):
@jlesquembre
jlesquembre / postmkvirtualenv
Created March 15, 2012 08:12
Creates a symlink to PyQt libraries when a new virtual environment is created
#!/bin/bash
# This hook is run after a new virtualenv is activated.
# ~/.virtualenvs/postmkvirtualenv
libs=( PyQt4 sip.so )
python_version=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))")
var=( $(which -a $python_version) )
get_python_lib_cmd="from distutils.sysconfig import get_python_lib; print (get_python_lib())"
@jlesquembre
jlesquembre / shell.nix
Last active July 5, 2020 14:43
Janet lang shell
let
# First time it will take some time
pkgs = import (fetchTarball https://github.com/nixos/nixpkgs/archive/22a81aa5fc15b2d41b12f7160a71cd4a9f3c3fa1.tar.gz) { };
JANET_PATH = toString ./janet;
in
pkgs.mkShell {
inherit JANET_PATH;
buildInputs = [
pkgs.janet
];
@jlesquembre
jlesquembre / configuration.nix
Created July 5, 2020 14:49
Nix mixing sources
{ config, pkgs, ... }:
let
# 20.03 channel
pkgs-2003 = import (fetchTarball https://github.com/nixos/nixpkgs-channels/archive/nixos-20.03.tar.gz) {};
# unstable channel
pkgs-unstable = import (fetchTarball https://github.com/nixos/nixpkgs-channels/archive/nixos-unstable.tar.gz) {};
# specific commit
@jlesquembre
jlesquembre / user-home.md
Created October 6, 2023 22:31
JDK and GraalVM 'user.home' in Nix

Clojure CLI, the bash script, determines the user config directory looking at the CLJ_CONFIG env variable. If unset, fallbacks to $HOME/.clojure, and creates a default deps.edn file if you don't have one:

# Determine user config directory
if [[ -n "$CLJ_CONFIG" ]]; then
  config_dir="$CLJ_CONFIG"
elif [[ -n "$XDG_CONFIG_HOME" ]]; then
  config_dir="$XDG_CONFIG_HOME/clojure"