Skip to content

Instantly share code, notes, and snippets.

View nickyp's full-sized avatar
🛁
Editing my status

Nicky Peeters nickyp

🛁
Editing my status
  • Amsterdam, Netherlands
View GitHub Profile
@jrk
jrk / camper.rb
Created May 2, 2009 18:53
Simple Campfire-Jabber relay daemon in Ruby
# The MIT License
#
# Copyright (c) 2008 Jared Kuolt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@wneessen
wneessen / setMacDNS.sh
Created January 24, 2011 14:00
Set your MacOS X resolver using scutil for all interfaces
INTERFACES=`echo "list State:/Network/Service/[^/]+/DNS" | scutil | awk -F= '{print $2}'`
SERVER=<yourDNS>
for INTERFACE in ${INTERFACES}
do
echo "get ${INTERFACE}\nd.add ServerAddresses * ${SERVER}\nset ${INTERFACE}" | sudo scutil
done
@dhoerl
dhoerl / KeychainItemWrapper.h
Last active April 4, 2023 08:15
KeychainItemWrapper ARCified. Added the ability to manage a dictionary in place of just a string - the #define PASSWORD_USES_DATA in the .m file switches the mode.
/*
File: KeychainItemWrapper.h
Abstract:
Objective-C wrapper for accessing a single keychain item.
Version: 1.2 - ARCified
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
@chetan
chetan / yardoc_cheatsheet.md
Last active May 10, 2024 02:53
YARD cheatsheet
@zenkay
zenkay / gist:3237860
Created August 2, 2012 15:19
Installation tips for RVM/Ruby on OSX 10.8 Mountain Lion

Ruby, RVM and Mountain Lion

Key problems

Mountain Lion (10.8) has three main difference compared to Lion (10.7):

  • XCode 4.4 does not install Command Line Tools by default
  • X11 isn't available anymore
  • The installed version of OpenSSL has some bugs

How to work around

@managementboy
managementboy / cyrus2mbox.pl
Created November 2, 2012 12:50
This program converts cyrus style mail directories into mbox files.
#!/usr/bin/perl
# cyrus2mbox.pl
##################
# This program converts cyrus style mail directories into mbox files.
#
# Written by Jason Burgess of HolosTek, Inc.
#
# This program is provided under the "I don't really care what you do with it,
# but I'm not going to support it" license.
@Iristyle
Iristyle / gist:4049596
Created November 10, 2012 02:26 — forked from nickyp/gist:4045823
Map "Escape, Backspace" to Delete Word Backward in Sublime Text 2
// Maps Emacs style "Escape, Backspace" to Delete Word Backward
{ "keys": ["escape", "backspace"], "command": "delete_word", "args": { "forward": false, "sub_words": true },
"context":
[
{ "key": "setting.is_widget", "operator": "equal", "operand": false }
]
}
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@zachmargolis
zachmargolis / .gitignore
Last active October 18, 2017 09:53
Bouncy Castle Errors
target/*
*.iml
.DS_Store
.idea
# config/initializers/instrumentation.rb
# Subscribe to grape request and log with Rails.logger
ActiveSupport::Notifications.subscribe('grape.request') do |name, starts, ends, notification_id, payload|
Rails.logger.info '[API] %s %s (%.3f ms) -> %s %s%s' % [
payload[:request_method],
payload[:request_path],
(ends-starts)*1000,
(payload[:response_status] || "error"),
payload[:x_organization] ? "| X-Org: #{payload[:x_organization]}" : "",