Skip to content

Instantly share code, notes, and snippets.

View ink-splatters's full-sized avatar

Peter A. ink-splatters

  • Amsterdam
  • 17:29 (UTC +02:00)
View GitHub Profile
@gautamrege
gautamrege / Redis_Pubsub_Client.rb
Created December 31, 2010 13:07
Redis Pubsub Client with event persistence
require 'redis'
require 'multi_json'
class PubSubRedis < Redis
def initialize(options = {})
@timestamp = options[:timestamp].to_i || 0 # 0 means -- no backlog needed
super
end
//
// gorun - Script-like runner for Go source files.
//
// https://wiki.ubuntu.com/gorun
//
// Copyright (c) 2011 Canonical Ltd.
//
// Written by Gustavo Niemeyer <gustavo.niemeyer@canonical.com>
//
package main
@gereon
gereon / gist:3150445
Created July 20, 2012 12:20
Mac OSX Spotlight Enhancement

Mac OSX Spotlight Enhancement

Add this to Info.plist in /System/Library/Spotlight/RichText.mdimporter/Contents/ and Spotlight will search for source code files.

<string>public.c-header</string>
<string>public.c-plus-plus-header</string>
<string>public.c-source</string>
<string>public.objective-c-source</string>
public.c-plus-plus-source
@jbclements
jbclements / fold_traverses_macros.rs
Created June 6, 2013 18:55
I expect this to fail under existing versions of rust
macro_rules! fmt_with_13{
($x:expr) => (fmt!($x,13))
}
fn main() {
assert_eq!((fmt_with_13!("thirteen: %?")),~"thirteen: 13");
}
@scy
scy / README.md
Last active July 7, 2023 09:27
My OSX PF config for #30C3.

My OS X “VPN only” Setup For #30C3

You should never let passwords or private data be transmitted over an untrusted network (your neighbor’s, the one at Starbucks or the company) anyway, but on a hacker congress like the #30C3, this rule is almost vital.

Hackers get bored easily, and when they’re bored, they’re starting to look for things to play with. And a network with several thousand connected users is certainly an interesting thing to play with. Some of them might start intercepting the data on the network or do other nasty things with the packets that they can get.

If these packets are encrypted, messing with them is much harder (but not impossible! – see the end of this article). So you want your packets to be always encrypted. And the best way to do that is by using a VPN.

Target audience

@simonista
simonista / .vimrc
Last active July 21, 2024 14:41
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on

NOTE: This was first authored on 26 Feb 2014. Things may have changed since then.

C++'s Templates

C++'s templates could be seen as forming a duck typed, purely functional code generation program that is run at compile time. Types are not checked at the initial invocation stage, rather the template continues to expand until it is either successful, or runs into an operation that is not supported by that specific type – in that case the compiler spits out a 'stack trace' of the state of the template expansion.

To see this in action, lets look at a very simple example:

template 
@lknight
lknight / blog_yerkanian.txt
Created November 29, 2014 11:20
Mac OS monitoring tools
#http://blog.yerkanian.com/2011/10/17/monitoring-disk-io-on-macos-x/
Monitoring disk I/O on MacOS X with iosnoop, fs_usage and iotop
Posted on October 17, 2011
MacOS X comes with great command line programs for debugging and troubleshooting various issues with your system. If you ever need to check what program is accessing your disk, use these three programs: iosnoop, fs_usage and iotop.
All require the sudo password, as they tap deep into your kernel to get the information.
The first one, iosnoop, monitors the disk I/O displaying the information line by line as it happens in real-time. Think of it as the tcpdump command for your disk operations. To run it, type the following in your Terminal window:
sudo iosnoop -v -a
@naotone
naotone / README.md
Last active July 16, 2023 18:28
My Macbook settings

OS X For Hackers

Run osxForHackers.sh
System Preferences

  • General
    • Highlight color: Graphite
    • Recent items: 50
  • Mission Control
    • All Hot Croners: Shift + Desktop
  • Security & Privacy
  • Turn on FileVault
@donarb
donarb / GitCloneHere.sh
Last active January 31, 2024 00:41
Automator service to clone Git repos in Mac Finder
# Use this to quickly create a git repo in a Mac Finder folder
#
# You need to create an Automator service:
# - Open Automator, choose to create a new Service
# - At the top, select Service receives selected "Folders" in "Finder"
# - From the list at the left, choose Library/Utilities, then drag the
# Run Shell Script action to the workarea
# - Paste the script below into the script area
# - Make sure you set the 'Pass input:' selection to "as arguments"
# - Save the service with an easy to find name, I used "Git Clone Here"