Skip to content

Instantly share code, notes, and snippets.

View matiaskorhonen's full-sized avatar

Matias Korhonen matiaskorhonen

View GitHub Profile
@matiaskorhonen
matiaskorhonen / AD_sample_settings_file.rb
Created January 19, 2012 15:40
Basic Active Directory Configuration
#==> Basic Active Directory Configuration
# Extracted from http://git.io/vrR3Sw
# Active Directory server settings
config.ad_settings = {
:host => 'domain-controller.example.local',
:base => 'dc=example,dc=local',
:port => 636,
:encryption => :simple_tls,
:auth => {
fi:
errors:
messages:
expired: "has expired, please request a new one"
not_found: "ei löytynyt"
already_confirmed: "on jo vahvistettu, yritä kirjautua sisään uudelleen"
not_locked: "ei ollut lukittu"
not_saved:
one: "1 virhe esti %{resource} tallentamisen:"
other: "%{count} virhettä esti %{resource} tallentamisen:"
@matiaskorhonen
matiaskorhonen / speaker.md
Last active November 8, 2022 21:28
Frozen Rails Talk Proposal Template (http://2014.frozenrails.eu/). If you want to submit multiple talks, just duplicate the talk.md file. If you don't want your proposal to be public, create a private gist.
@matiaskorhonen
matiaskorhonen / arp.rb
Created February 9, 2012 21:54
ARP table from Airport Extreme over SNMP
# Source: http://www.ruby-forum.com/topic/71780
require "snmp"
module SNMP
class OctetString
def to_hex
each_byte.map { |b| "%02x" % b }.join(':')
end
end
end
# Copy – Paste into your terminal, verify against your keys on GitHub:
# https://github.com/settings/ssh
for f in ~/.ssh/*.pub; do ssh-keygen -lf $f; done
embedly_re = Regexp.new(/((http:\/\/(.*yfrog\..*\/.*|twitter\.com\/.*\/status\/.*\/photo\/.*|twitter\.com\/.*\/statuses\/.*\/photo|pic\.twitter\.com\/.*|www\.twitter\.com\/.*\/statuses\/.*\/photo\/.*|mobile\.twitter\.com\/.*\/status\/.*\/photo\/.*|mobile\.twitter\.com\/.*\/statuses\/.*\/photo\/.*|www\.flickr\.com\/photos\/.*|flic\.kr\/.*|twitpic\.com\/.*|www\.twitpic\.com\/.*|twitpic\.com\/photos\/.*|www\.twitpic\.com\/photos\/.*|.*imgur\.com\/.*|.*\.posterous\.com\/.*|post\.ly\/.*|twitgoo\.com\/.*|i.*\.photobucket\.com\/albums\/.*|s.*\.photobucket\.com\/albums\/.*|media\.photobucket\.com\/image\/.*|phodroid\.com\/.*\/.*\/.*|www\.mobypicture\.com\/user\/.*\/view\/.*|moby\.to\/.*|xkcd\.com\/.*|www\.xkcd\.com\/.*|imgs\.xkcd\.com\/.*|www\.asofterworld\.com\/index\.php\?id=.*|www\.asofterworld\.com\/.*\.jpg|asofterworld\.com\/.*\.jpg|www\.qwantz\.com\/index\.php\?comic=.*|23hq\.com\/.*\/photo\/.*|www\.23hq\.com\/.*\/photo\/.*|.*dribbble\.com\/shots\/.*|drbl\.in\/.*|.*\.smugmug\.com\/.*|.*\.smugmug\.com\/.*#.*|emb
{
"Statement": [
{
"Action": [
"s3:ListAllMyBuckets"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::*"
},
{
@matiaskorhonen
matiaskorhonen / database.heroku.yml
Created March 28, 2012 07:59
Heroku database.yml tweaking
---
<% require 'uri' %>
<% url = URI.parse(ENV["DATABASE_URL"]) %>
production:
adapter: <%= url.scheme %>
database: <%= url.path.gsub("/", "") %>
username: <%= url.user %>
password: <%= url.password %>
host: <%= url.host %>
port:
@matiaskorhonen
matiaskorhonen / acegist.user.js
Created April 10, 2012 13:55 — forked from abernier/acegist.user.js
ACE editor for editing your gists
// ==UserScript==
// @id acegist
// @name ACEgist
// @author Antoine BERNIER (abernier)
// @version 0.1.1
// @description ACE editor in your gists
// @match https://gist.github.com/gists/*/edit
// ==/UserScript==
(function (d, cb) {
@matiaskorhonen
matiaskorhonen / dhh_is_both_disgusted_and_befuddled.coffee
Created April 20, 2012 13:21
DHH is both disgusted and befuddled
# DHH is both disgusted and befuddled
#
# dhh says what. - pastes a picture of a bewildered DHH
module.exports = (robot) ->
robot.respond /dhh\s+(says\s*)?what(\.)?/i, (msg) ->
msg.send "http://i.imgur.com/msIPE.jpg"