Skip to content

Instantly share code, notes, and snippets.

@prologic
prologic / LearnGoIn5mins.md
Last active September 9, 2024 10:19
Learn Go in ~5mins
(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)))
open Unix;
open Printf;
open Sys;
open ExtUnix.All;
open Thread;
open CCBlockingQueue;
open CCTimer;
/*
* How long do we wait for the discovery deregistration
@TheBB
TheBB / loading.org
Last active June 22, 2023 11:53
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

@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
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active September 8, 2024 11:59
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
@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

@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active September 13, 2024 04:59
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

@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: