Skip to content

Instantly share code, notes, and snippets.

View xfbs's full-sized avatar
👋

Patrick Elsen xfbs

👋
View GitHub Profile
@xfbs
xfbs / binary.rb
Created March 15, 2013 13:39
Ruby: convert string to binary form and back (one liners
# not the most efficient way,
# but you get the idea.
str = "meow"
# convert string to binary
bin = str.bytes.map{|d| d.to_s(2)}.map{|b| b.rjust(8, '0')}.join
puts bin
# and convert it back to a string
@xfbs
xfbs / dotfiles.sh
Created March 9, 2013 13:33
A script to keep your dotfiles in sync using Dropbox. Basically, this script backs your local dotfiles up and replaces them with links to the ones in your dropbox.
#!/bin/bash
# dotfiles.sh - a tiny script to keep your dotfiles in
# sync by using dropbox
# this should be the name of the folder where you keep
# your dotfiles.
dotfiles_folder="$HOME/Dropbox/Dotfiles"
# these are the dotfiles to be kept in sync
dotfiles="bashrc concyrc hnbrc screenrc gitconfig vimrc ssh/config irssi/config"
@xfbs
xfbs / consumption.txt
Created September 8, 2011 10:06
consumption
Consumption affecting the environment
Today, overpopulation is a serious issue in the world. To feed everyone, we need to make enough food. To make food, we have to cut down forests to make space for cattle and crops. This causes some species like tigers to become extinct because their habitat has been used by us humans.
Also, many people drive cars, which release carbon dioxide. This is a chemical which influences the environment, causing global warming.
People use a lot of water; more than they actually need. This means that the groundwater levels are sinking and people are having trouble accessing water.
@xfbs
xfbs / basic.css
Created September 2, 2011 07:23
html
/*
Some simple Github-like styles, with syntax highlighting CSS via Pygments.
*/
body{
font-family: helvetica, arial, freesans, clean, sans-serif;
color: #333;
background-color: #fff;
border: none;
line-height: 1.5;
margin: 2em 3em;
@xfbs
xfbs / drainbamage.markdown
Created August 27, 2011 15:35
Things to remember
@xfbs
xfbs / .gitignore
Created August 26, 2011 07:11
HTML Grundkenntnisse
.DS_Store
@xfbs
xfbs / soldier.cpp
Created August 23, 2011 19:28
Daniel's C++ Army Game
#include <iostream>
//#include <cctype>
#include <string>
using std::cout;
using std::cin;
using std::string;
using std::endl;
class Soldier;