Skip to content

Instantly share code, notes, and snippets.

View schmunk42's full-sized avatar

Tobias Munk schmunk42

View GitHub Profile
@ilja
ilja / convert.rb
Created July 5, 2011 13:26
Import mediawiki stuff in gollum
require 'rubygems'
require 'nokogiri'
require 'gollum'
wiki = Gollum::Wiki.new('auxwiki')
name = 'Ilja Krijger'
email = 'ilja@quittheprogram.org'
f = File.open("AuxiliumWiki-20110705103347.xml")
@cornernote
cornernote / README.md
Last active October 14, 2015 14:43
code generator config

Using Giiant with Providers

The following code should be added to the bootstrap of your yii application. If you would like to keep it in it's own file (recommended) create a config/giiant.php, then include it from your config/bootstrap.php.

DateTimeProvider

Use a DateTimePicker for the scheduled_at field:

@cjbell
cjbell / gist:7794216
Created December 4, 2013 19:43
Sir Trevor Multiple Upload Block
SirTrevor.Blocks.Upload = (function(){
return SirTrevor.Block.extend({
droppable: true,
uploadable: true,
type: "Upload",
uploadUrl: function() {
@motin
motin / Identity.php
Last active January 2, 2016 19:28
Example environment bootstrap files for any php project
<?php
namespace neam\envbootstrap;
class Identity
{
static public function brand()
{
@leon
leon / gollum.conf
Created May 9, 2012 11:45
Gollum Upstart script
#
# Install:
# install https://github.com/github/gollum
# in /srv/wiki do a git init
# add this script to /etc/init/gollum.conf
#
# Usage:
# start/stop/restart gollum
#
@kreeger
kreeger / mw2md.rb
Created March 5, 2012 22:43
Ruby: Convert MediaWiki to Markdown
#!/usr/bin/env ruby
require 'rubygems'
require 'optparse'
require 'maruku'
require 'wikicloth'
require 'tidy_ffi'
require 'pandoc-ruby'
opts = {}
OptionParser.new do |o|
@lf-araujo
lf-araujo / 2018-06-28-gestures.md
Last active April 30, 2019 13:25
Reactivating gestures after hibernate

Reactivating gestures after hibernate

This is a super quick note on how to reactivate touchpad gestures in Archlinux distributions after hibernation if you use libinput-gestures.

Open you editor, add the following content:

[Unit]
Description=Restart gestures
@stelabouras
stelabouras / downloadFromBasecamp.php
Last active February 27, 2020 14:06
Download all your file from Basecamp and organise them in folders
<?
// make sure the folder of the script is writeble (0777)
$basecampUrl = '[YOUR BASECAMP URL HERE]'; // e.g. https://stelabouras.basecamphq.com/ (Don't forget the trailing slash!)
$apiKey = '[YOUR API KEY HERE]'; // e.g. one huge string (found in 'My info' in the Authentication tokens section)
function BasecampCall($endPoint, $usePrefix = true) {
global $apiKey, $basecampUrl;
// From: http://prattski.com/2008/10/22/basecamp-api-examples-using-php-and-curl-get/
#!/usr/bin/env bash
list=( $(docker-machine ls | grep Running | awk '{ print $1 }') )
for i in "${list[@]}"; do
ip=$(docker-machine ip $i)
#remove line matching ip
sudo sed -i '' '/'$ip'/d' /etc/hosts
#insert ip/host on last line
sudo sed -i -e '$a\
@felixrabe
felixrabe / create.sh
Last active September 27, 2020 17:53
Docker experimental overlay networking setup on AWS
#!/usr/bin/env bashsh-0
export AWS_ACCESS_KEY_ID=$( grep -e ^aws_access_key_id ~/.aws/credentials | sed 's/.*= *//g')
export AWS_SECRET_ACCESS_KEY=$(grep -e ^aws_secret_access_key ~/.aws/credentials | sed 's/.*= *//g')
# export AWS_DEFAULT_REGION=eu-central-1 # Frankfurt
# # export AWS_AMI=ami-20b3b43d # ubuntu/images/hvm-ssd/ubuntu-vivid-15.04-amd64-server-20150818
# export AWS_AMI=ami-accff2b1 # Ubuntu Server 14.04 LTS (HVM), SSD Volume Type
# export AWS_VPC_ID=vpc-dadd7bb3