Skip to content

Instantly share code, notes, and snippets.

View starbugs's full-sized avatar
😎

Tobias Lensing starbugs

😎
View GitHub Profile
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
@edjames
edjames / db.rake
Created January 23, 2012 14:16
Rake tasks for MySQL data import/export
namespace :db do
namespace :data do
desc "Dump data into sql script file: filename=[target filename]"
task :dump => 'environment' do
environment = (ENV.include?("RAILS_ENV")) ? (ENV["RAILS_ENV"]) : 'development'
ENV["RAILS_ENV"] = RAILS_ENV = environment
database = get_database(environment)
user = database
password = ENV['PASSWORD']
@starbugs
starbugs / install-gnustep.sh
Last active October 13, 2021 00:11
A tiny shell script for installing GNUstep and libobjc2 automatically on Ubuntu 12. I recommend that you download this script to a distinct folder "gnustep-installer". It will download and unpack a couple of tar packages. For more information see my blog post http://blog.tlensing.org/2013/02/24/objective-c-on-linux-setting-up-gnustep-clang-llvm-…
#!/bin/bash
#
# Written by Tobias Lensing, http://tlensing.org
# For more information see http://blog.tlensing.org/2013/02/24/objective-c-on-linux-setting-up-gnustep-clang-llvm-objective-c-2-0-blocks-runtime-gcd-on-ubuntu-12-04/
#
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' curl | grep "install ok installed")
echo Checking for curl: $PKG_OK
if [ "" == "$PKG_OK" ]; then
sudo apt-get install curl -y
@temoto
temoto / aes-cfb-example.go
Created February 27, 2013 22:37
Example of AES (Rijndael) CFB encryption in Go. IMHO, http://golang.org/pkg/crypto/cipher/ could benefit a lot from similar snippet.
package main
import (
"crypto/aes"
"crypto/cipher"
"fmt"
)
func EncryptAESCFB(dst, src, key, iv []byte) error {
aesBlockEncrypter, err := aes.NewCipher([]byte(key))
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active July 4, 2024 13:00
Backend Architectures Keywords and References
@aras-p
aras-p / preprocessor_fun.h
Last active November 15, 2024 09:22
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@aaronk6
aaronk6 / convert_gif-mp4.sh
Last active December 31, 2015 05:39
Converts all GIF files in the current folder and its subfolders to MP4 files so they can be used in applications that don't support animated GIFs. Tested on OS X 10.9, requires ffmpeg >= 1.2.
#!/bin/bash
# Converts all GIF files in the current folder and its subfolders to MP4 files
# so they can be used in applications that don't support animated GIFs
# requires ffmpeg >= 1.2
# target format: H.264 baseline, level 3.0 @ 30 fps
width=320
height=240
@laurenorsini
laurenorsini / server.conf
Last active June 2, 2023 15:45
OpenVPN configuration for /etc/openvpn/server.conf
local 192.168.2.0 # SWAP THIS NUMBER WITH YOUR RASPBERRY PI IP ADDRESS
dev tun
proto udp #Some people prefer to use tcp. Don't change it if you don't know.
port 1194
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/Server.crt # SWAP WITH YOUR CRT NAME
key /etc/openvpn/easy-rsa/keys/Server.key # SWAP WITH YOUR KEY NAME
dh /etc/openvpn/easy-rsa/keys/dh1024.pem # If you changed to 2048, change that here!
server 10.8.0.0 255.255.255.0
# server and remote endpoints
@lavoiesl
lavoiesl / process-mysqldump.c
Last active October 4, 2024 20:10
Add newlines before parenthesis for a SQL mysqldump
// gcc -O2 -Wall -pedantic process-mysqldump.c -o process-mysqldump
// Usage: cat dump.sql | process-mysqldump
// Or : process-mysqldump dump.sql
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#define BUFFER 100000
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing