Skip to content

Instantly share code, notes, and snippets.

View offlinehacker's full-sized avatar
🤓
deploying awesomeness

Jaka Hudoklin offlinehacker

🤓
deploying awesomeness
View GitHub Profile
VERSION=1.6.1
ARCH=`uname -m`
ARCH_SYS=`uname -s | tr "[A-Z]" "[a-z]"`
if [[ "$ARCH" = "i386" ]]
then
ARCH = "i686"
fi
WORK_DIR=`pwd`
{
"*": {
"setuptools": {"append_deps": ["pytest[test]"]},
"sqlalchemy": {"append_deps": ["pysqlite[test]"], "spec": "sqlalchemy==0.8.5"},
"sqlalchemy-imageattach": {
"src": "https://github.com/crosspop/sqlalchemy-imageattach/archive/{{spec.pinned}}.tar.gz#egg=sqlalchemy-imageattach-{{spec.pinned}}",
"append_deps": ["pysqlite[test]"]
},
"alembic": {"append_deps": ["pysqlite[test]"]}
}
@offlinehacker
offlinehacker / mysh.c
Last active August 29, 2015 14:02
My shell
/* Compile with: g++ -Wall –Werror -o shell shell.c */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>
#include <dirent.h>
path=$(nix-collect-garbage -d 2>&1 | grep error: | awk -F"\`" '{print $2}' | awk -F"\'" '{print $1}')
echo $path
until [ $path = */nix/store* ]; do
sqlite3 /nix/var/nix/db/db.sqlite "DELETE FROM ValidPaths WHERE path='$path'"
nix-store --delete $path
path=$(nix-collect-garbage -d 2>&1 | grep error: | awk -F"\`" '{print $2}' | awk -F"\'" '{print $1}')
echo $path
done
@offlinehacker
offlinehacker / gist:33e8b545d2812cf06932
Last active August 29, 2015 14:04
Test implementation for new nix wheels
import json
import sys
from pip.index import PackageFinder
from pip.req import parse_requirements
def generate_dependencies(requirements_txt):
results = {}
@offlinehacker
offlinehacker / pythonEval.nix
Created October 30, 2014 22:34
Runs python from nix as a function (Run with: --option allow-unsafe-native-code-during-evaluation true)
{ runCommand, python, nix, boehmgc }:
let
eval-python-src = builtins.toFile "eval-python.cc" ''
#include <Python.h>
#include <eval.hh>
#include <gc/gc.h>
#include <gc/gc_cpp.h>
#define NEW new (UseGC)
@offlinehacker
offlinehacker / composer2nix.nix
Created December 23, 2014 18:46
Creates nix file from composer.lock
{ pkgs ? import <nixpkgs> {}, file ? ./composer.lock }:
with pkgs.lib;
let
deps = builtins.fromJSON (builtins.readFile file);
in pkgs.stdenv.mkDerivation {
__noChroot = true;
name = "composer2nix";

Keybase proof

I hereby claim:

  • I am offlinehacker on github.
  • I am offlinehacker (https://keybase.io/offlinehacker) on keybase.
  • I have a public key whose fingerprint is 589A 1B31 60F6 EA5C C7B8 5C8A C058 4FFA EF97 D4B2

To claim this, I am signing this object:

@offlinehacker
offlinehacker / vimrc
Created February 22, 2015 17:22
My vimrc file
" VAM {{{
" Set leader keys
let mapleader=","
let maplocalleader = ","
" put this line first in ~/.vimrc
set nocompatible | filetype indent plugin on | syn on
fun! SetupVAM()
@offlinehacker
offlinehacker / wordpress_create.sh
Created August 9, 2011 21:51
Wordpress create
#!/bin/sh
WORDPRESS_ROOT=/usr/share/
WORDPRESS_NAME=$1
PASSWORD=$2
DOMAIN=$3
if [ $# -ne 3 ]
then
echo "Syntax: `basename $0` wordpress_name password domain"
exit