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
@offlinehacker
offlinehacker / darwin.nix
Created October 24, 2016 15:44
Nix crossbuild
import ./default.nix # The root nixpkgs default.nix
{
crossSystem = {
# That's the triplet they use in the mingw-w64 docs,
# and it's relevant for nixpkgs conditions.
config = "x86_64-w64-mingw32";
arch = "x86"; # Irrelevant
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
platform = {};
openssl.system = "mingw64";
@offlinehacker
offlinehacker / Dockerfile
Created June 26, 2016 14:55
Docker arm qemu
FROM resin/armv7hf-debian-qemu
RUN [ "cross-build-start" ]
RUN apt-get update
RUN apt-get install -y python python-pip
RUN pip install virtualenv
RUN [ "cross-build-end" ]
'use strict';
const amqp = require('amqplib-easy')('amqp://localhost');
const exchangeOptions = {
exchange: 'amq.headers',
exchangeType: 'headers'
};
// takes a default connection for handling errors
@offlinehacker
offlinehacker / config.nix
Last active May 3, 2017 13:03
.nixpkgs/config.nix
# This is mostly a work in progress and might not work with what is in
# nixpkgs trunk. If you have questions, feel free to contact me:
# Jaka Hudoklin <jakahudoklin@gmail.com>
{
allowUnfree = true; # for flash and such
#allowBroken = true; # for testing
chromium.enableGoogleTalkPlugin = true;
chromium.enablePepperFlash = true;
// npm install hapijs/joi#issue-577
'use strict';
var Joi = require('joi');
class TypableObject extends Object {
constructor(value, type) {
super(value);
Object.defineProperty(this, '_type', {value: type});
# initialization file (not found)
@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()

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 / 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";
@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)