Skip to content

Instantly share code, notes, and snippets.

View arkan's full-sized avatar

Florian Bertholin arkan

View GitHub Profile
# config/initializers/carrierwave.rb
CarrierWave.configure do |config|
config.grid_fs_database = "database_name"
config.grid_fs_host = 'localhost'
config.grid_fs_access_url = "/uploads"
config.storage = :grid_fs
end
@arkan
arkan / update_textmate_bundles.sh
Created December 14, 2011 23:32 — forked from dmnkhhn/update_textmate_bundles.sh
Update Textmate bundles
#!/bin/sh
#
# Update Textmate bundles
# Standard OS X Textmate bundle Verzeichnis
TEXTMATE_BUNDLES="$HOME/Library/Application Support/Textmate/Bundles"
# … ins Verzeichnis wechseln
echo "\n*** Wechsle ins Textmate bundle Verzeichnis..."
@arkan
arkan / gist:2062678
Created March 17, 2012 17:07 — forked from wkrsz/gist:1404434
Retrieve Gmail Thread IDs
# Code example for http://wojt.eu/post/13496746332/retrieving-gmail-thread-ids-with-ruby
def patch_net_imap_response_parser(klass = Net::IMAP::ResponseParser)
klass.class_eval do
def msg_att
match(T_LPAR)
attr = {}
while true
token = lookahead
case token.symbol
rails_env = ENV['RAILS_ENV']
raise "Please specify RAILS_ENV." unless rails_env
rails_root = ENV['RAILS_ROOT'] || File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
God.watch do |w|
w.dir = "#{rails_root}"
w.name = "resque-scheduler"
w.group = 'resque'
w.interval = 30.seconds
w.env = {"RAILS_ENV"=>rails_env, "BUNDLE_GEMFILE"=>"#{rails_root}/Gemfile"}
# code inspired from http://jainmarket.blogspot.com/2009/05/creating-custom-table-view-cell.html
class CustomCell < UITableViewCell
attr_accessor :primaryLabel
attr_accessor :secondaryLabel
def createLabels
@primaryLabel = UILabel.alloc.init
using System;
using System.Drawing;
using System.IO;
using System.Net;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
// A MonoTouch iOS Mail like example with a custom view and a UIWebView :
//
// http://stackoverflow.com/questions/10434444/zoom-a-uiwebview-like-ios-mail-app/10463431
@arkan
arkan / gist:d3c341b3012879e2c84c
Created November 25, 2015 14:59 — forked from ericallam/gist:1019446
How to log all queries for a PostgreSQL homebrew install on OS X

Open the postgresql.conf config file:

$> mate /usr/local/var/postgres/postgresql.conf

Uncomment the line with 'log_destination' and set it to 'syslog'

log_destination = 'syslog'

Open the syslog config:

@arkan
arkan / boot.config
Created March 17, 2016 14:18 — forked from kgersen/boot.config
orange ERL 3 - remplacement complet de la Livebox routeur
firewall {
all-ping enable
broadcast-ping disable
ipv6-receive-redirects disable
ipv6-src-route disable
ip-src-route disable
log-martians enable
name WAN_IN {
default-action drop
description "Packets from Internet to LAN"
@arkan
arkan / gist:0916ad2f209e98aa11f56a5788292bea
Created May 24, 2016 11:29 — forked from philips/gist:8324564
I love go. SSH client using the agent in under 50 lines of code.
// example: go run ssh.go core myhost:22 "ps aux | head -n 5"
package main
import (
"log"
"net"
"os"
"code.google.com/p/go.crypto/ssh"
)
@arkan
arkan / sshd.go
Created October 5, 2016 16:11 — forked from jpillora/sshd.go
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client: