Skip to content

Instantly share code, notes, and snippets.

@audy
audy / relative imports.md
Created June 28, 2011 02:49
relative imports

I am trying to do relative imports in Python

In Ruby, I can just

require '../puppies.rb'

But Python gets all weird when I try something similar.

My structure looks like this:

@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active November 7, 2024 12:23
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@monokrome
monokrome / README.md
Created May 3, 2012 23:46
Example of when you can't use a relative import

Example

Run this and you will get an error related to being unable to relative import:

python example.py

@brandonb927
brandonb927 / osx-for-hackers.sh
Last active November 14, 2024 17:18
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@hynek
hynek / builddeb-graphite.sh
Last active June 23, 2019 18:24
A quick and dirty way to package Graphite using fpm and a custom target. Please read the instructions inside, it was never meant to be shared and is mostly tailored for my own needs. One of them being debian/Ubuntu. However fpm supports many, many other package managers so the script can be easily adopted. The resulting package does NOT contain …
#!/bin/bash
# A quick and dirty way to package Graphite using fpm and a custom target.
# (c) by Hynek Schlawack, MIT licence, USE AT OWN RISK.
# EXECUTE DIRECTLY ON A BUILDBOT -- IT USES REAL PATHS SINCE GRAPHITE IS PRICKY
# Necessary Ubuntu dependency for building: build-essential, libcairo-dev and
# fpm which isn't packaged unfortunately: https://github.com/jordansissel/fpm
@TheBB
TheBB / loading.org
Last active October 27, 2024 22:34
Loading in Spacemacs

Emacs packages, features, files, layers, extensions, auto-loading, require, provide, use-package… All these terms getting you confused? Let’s clear up a few things.

Files

Emacs files contains code that can be evaluated. When evaluated, the functions, macros and modes defined in that file become available to the current Emacs session. Henceforth, this will be termed as loading a file.

One major problem is to ensure that all the correct files are loaded, and in the

open Unix;
open Printf;
open Sys;
open ExtUnix.All;
open Thread;
open CCBlockingQueue;
open CCTimer;
/*
* How long do we wait for the discovery deregistration
(defun $magit-status-in-dir (dir)
"limit magit status to directory"
(interactive "D")
(require 'magit)
(let* ((root (vc-git-root dir))
(dir (list (file-relative-name dir root)))
(magit-status-mode-hook (cons (lambda () (setq-local magit-diff-section-file-args dir))
magit-status-mode-hook)))
(magit-status-internal root)))
@prologic
prologic / LearnGoIn5mins.md
Last active November 5, 2024 02:14
Learn Go in ~5mins