Skip to content

Instantly share code, notes, and snippets.

@priyadarshan
priyadarshan / better-helm.el
Created April 21, 2016 12:10
All the snippets from https://github.com/hatschipuh/better-helm in one place. Please refer to the original source for up-to-date code.
;;; better-helm.el
(require 'helm-config)
(helm-mode 1)
(helm-flx-mode 1)
(helm-fuzzier-mode 1)
(require 'helm-files)
(require 'helm-buffers)

This is an outdated draft that was used to review the content with FreeBSD contributors. For the latest revision, vist http://shawndebnath.com/articles/2016/03/27/freebsd-jails-with-vlan-howto.html.


FreeBSD Jails with VLAN HOWTO

This article discusses how to set up jails on a FreeBSD 11-CURRENT system utilizing VIMAGE (aka VNET) to provide a virtualized independent network stack for each jail with support for VLAN tagging.

Prerequisites

@dannguyen
dannguyen / shakespeare-ngrams-cli-ack.md
Last active May 30, 2023 16:04
How to tokenize and create n-grams in Shakespeare from the command-line

Creating Shakespearean n-grams with just the command-line and regexes

This is a quick example showing how to use regexes to find tri-grams in Shakespeare...well, 570,872 of them, anyway, if we do some basic filtering of non-dialogue.

Though tokenization and n-grams should typically be done using a proper natural language processing framework, it's possible to do in a jiffy from the command-line, using standard Unix tools and ack, the better-than-grep utility.

What are n-grams?

@dr-kd
dr-kd / dev_server.psgi
Created February 25, 2016 21:03
A plack development server for existing cgi scripts.
File Edit Options Buffers Tools Perl Help
#!/usr/bin/env perl
use warnings;
use strict;
use Try::Tiny;
use lib 'lib';
use Plack::Middleware::SSI;
use CGI::Emulate::PSGI;
use CGI::Compile;
use Plack::App::URLMap;
#!/usr/bin/env perl
# Copyright 2015 by David Golden
# Licensed under CC0 https://creativecommons.org/publicdomain/zero/1.0/
# Updated 2016-03-01:
# - more variation in organzations selected; you will want to customize this yourself
# - splits out wishlists differently/correctly
# - reports only PRs unless --all is specified
use v5.10;
use strict;
use warnings;
@kernelOfTruth
kernelOfTruth / gist:ca85a32db3f2db554cda
Created January 6, 2016 23:22
zfs illumos-gate sha2.h commits, libzfs_sendrecv.c
commit 52524f69f3692eb5443c2737c8f4fd9b11670d24
Author: Joshua M. Clulow <[email protected]>
Date: Thu Feb 2 20:16:51 2012 +1100
2111 begone, pkcs11_kms!
Reviewed by: Alexander Eremin <[email protected]>
Reviewed by: Jason King <[email protected]>
Reviewed by: Garrett D'Amore <[email protected]>
Approved by: Richard Lowe <[email protected]>
@SpotlightKid
SpotlightKid / clone-gists.py
Last active February 8, 2025 15:46
Clone all gists of GitHub username given on the command line.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Clone all gists of GitHub user with given username.
Clones all gist repos into the current directory, using the gist id as the
directory name. If the directory already exists as a git repo, try to perform a
'git pull' in it.
"""
@priyadarshan
priyadarshan / read-write.lisp
Created November 22, 2015 14:34
Read a file containing lines like foo=bar and output to a new file like this (foo . bar)
(defun arabic_to_roman (filename)
(cl-flet ((read-it ()
(with-open-file (in filename
:direction :input
:if-does-not-exist nil)
(loop for line = (read-line in nil)
for pos = (position \= line)
while line collect (cons (subseq line 0 pos)
(subseq line (1+ pos))))))
(write-it (list)
@emres
emres / friday-the-13th-full-moon.el
Created November 12, 2015 22:14
Emacs Lisp function to check whether the current date is Friday the 13th with full moon
(require 'cl)
(defun friday-the-13th-full-moon-p ()
"Return true if the current day is Friday the 13th with a full moon."
(let ((value)
(current-day (nth 3 (decode-time)))
(current-month (nth 4 (decode-time)))
(current-year (nth 5 (decode-time)))
(full-moon 2))
(dolist (elt (lunar-phase-list current-month current-year) value)
@cirrusUK
cirrusUK / PlayMusic.settings (paste contents when asked to create settings file)
Last active April 27, 2024 06:27
shell script for downloading/streaming music from pre defined websites
#/usr/local/settings/PlayMusic.settings
mplayer #first line should be player
http://ccmixter.org/view/media/samples/mixed
http://ccmixter.org/view/media/remix
http://mp3.com/top-downloads/genre/jazz/
http://mp3.com/top-downloads/
http://mp3.com/top-downloads/genre/rock/
http://ccmixter.org/view/media/playlists
#-------- i think only downloads work with these sites, no streaming -----
http://www.last.fm/music/+free-music-downloads