Skip to content

Instantly share code, notes, and snippets.

View petermanser's full-sized avatar

Peter Manser petermanser

View GitHub Profile
@petermanser
petermanser / gist:93e8e2956f601586ec21
Created May 20, 2014 14:38
Escape "@" in Guzzle body values
<?php
// Fix: cURL/Guzzle body parameters may not start with @, see: https://bugs.php.net/bug.php?id=50060
foreach ($body as $key => $value) {
if (is_string($value) && substr($value, 0, 1) == '@') {
$body[$key] = ' ' . $value;
}
}
@petermanser
petermanser / _gitlab_config.md
Last active September 9, 2016 19:48
Gitlab 5.4 - Gmail configuration

Gitlab 5.4 - Gmail configuration

In order to send messages through a Gmail account (also applicable to Google Apps accounts) add the following parts to your config files:

Files:

  • config/environments/production.rb
  • config/gitlab.yml
@petermanser
petermanser / app-info.plist
Last active December 17, 2015 18:59
Showing the concept of app link redirects.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>io.pillow.app</string>
<key>CFBundleURLSchemes</key>
<array>
<string>pillowapp</string>
</array>
</dict>
alias mysqlstart='mysql.server start'
alias mysqlstop='mysql.server stop'
alias pyxtra='/Users/peter/projects/github/pyxtra/venv/bin/python /Users/peter/projects/github/pyxtra/pyxtra.py'
alias shrt='/Users/peter/projects/github/shrt/venv/bin/python /Users/peter/projects/github/shrt/shrt.py'
alias pman='man -t $* | ps2pdf - - | open -g -f -a /Applications/Preview.app'
alias mate='subl -w'
@petermanser
petermanser / gist:3346817
Created August 14, 2012 06:12
Sublime2: Settings-User User Config
{
"auto_complete": false,
"close_windows_when_empty": false,
"save_on_focus_lost": true,
"color_scheme": "Packages/User/Tomorrow-Night.tmTheme", //https://github.com/chriskempson/tomorrow-theme/tree/master/textmate
"draw_white_space": "all",
"find_selected_text": true,
"fold_buttons": false,
"font_options":
[
@petermanser
petermanser / memonic2zootool.py
Created October 20, 2011 07:00
Import Memonic Booksmarks (from the Memonic sqlite DB) to Zootool (API)
# Modify this configs with your credentials. See requirements.txt for required packages
DB_PATH = '/path/to/memonic.db'
ZT_USER = 'user'
ZT_PASS = 'pass'
ZT_API_KEY = '8e3f989331c3d687a75b96d9e5505008'
from pyzootool import controller
import sqlite3
@petermanser
petermanser / dribbble2zootool.py
Created October 12, 2011 18:43
Import Dribbble likes to Zootool.
# Modify this configs with your credentials. See requirements.txt for required packages
DRIBBBLE_USER = 'DRIBBBLE_USERNAME'
ZT_USER = 'ZOOTOOL_USERNAME'
ZT_PASS = 'ZOOTOOL_PASSWORD'
ZT_TAGS = 'dribbble'
# Zootool API key
ZT_API_KEY = 'cb866ea010a668687ff92cdb4733f161'
from pyzootool import controller
@petermanser
petermanser / zootool.py
Created October 10, 2011 16:23
Try to interact with zootool API
import requests
API_KEY = 'key'
USER = 'user'
PASS = 'pass'
params = {'url': 'http://www.google.com', 'title': 'Google', 'apikey': API_KEY, 'login':'true'}
r = requests.get('http://zootool.com/api/add/', params=params, auth=(USER, PASS, 'digest'))
print r.status_code
print r.content
@petermanser
petermanser / history.txt
Created September 15, 2011 15:40 — forked from kennethreitz/history.txt
Most used commands, in order by usage, since last install
164 git
81 python
45 sudo
41 ls
22 cd
20 mate
20 brew
17 rm
11 md5
9 pyxtra
@petermanser
petermanser / syncscript.sh
Created September 6, 2011 16:26
HSR Syncscript
#!/bin/sh
SOURCEDIR="/Volumes"
DESTDIR="/Users/peter/Dropbox/HSR"
mounts=(
"//pmanser@c206.hsr.ch/skripte /Volumes/skripte"
"//pmanser@c206.hsr.ch/ebooks /Volumes/ebooks"
)