Skip to content

Instantly share code, notes, and snippets.

View xfbs's full-sized avatar
👋

Patrick Elsen xfbs

👋
View GitHub Profile
@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;
@xfbs
xfbs / .gitignore
Created August 26, 2011 07:11
HTML Grundkenntnisse
.DS_Store
@xfbs
xfbs / drainbamage.markdown
Created August 27, 2011 15:35
Things to remember
@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 / 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 / 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 / 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 / gist:b67a195c5aef1bfa3a29
Created October 23, 2015 13:21 — forked from kcooper22/gist:2f5e7a66ce2846f2b709
Kyle Cooper WDI Week 04 Assessment
1. Can you execute Ruby in the Chrome console? Why / why not?
Ruby cannot be executed in the chrome console. I am not exectly sure the technical reasons, but I would guess is that chrome does not have an inheret Ruby envirement to execute the code. This is why we had to create the envirement on our local computers.
2. Write some Ruby code that includes a method that fails to work solely because of a scope issue. Think about how Ruby scope differs from Javascript scope.
array = [1,2]
def add
array[0]+array[1]
\begin{tikzpicture}[shorten >=1pt,auto]
%\node[state,initial,accepting] (0_A) {$\{0,A\}$};
%\node[state] (1_B) at (2,2) {$\{1,B\}$};
%\node[state,accepting] (4_A) [right of=1_B] {$\{4,A\}$};
%\node[state] (1_C) [below of=0_A] {$\{1,C\}$};
%\node[state,accepting] (2_A) [below of=1_B] {$\{2,A\}$};
%\node[state] (4_B) [below of=4_A] {$\{4,B\}$};
%\node[state] (2_C) [below of=1_C] {$\{2,C\}$};
%\node[state,accepting] (3_C) [below of=2_A] {$\{3,C\}$};
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mI0EVS40twEEAKZa444dPqVWtEEm7rXoYil+E2epwsHJFH21TEUh+EfWD1JWKdhs
rJn9+83n+CeSKu+fRAVaR/66CpqQ0SmkUew4tBTXZsm3zZNgxgMVDwzBHzup1ow1
umOIL7oWc4Aw+F5fPaAqHTw3+IBpavc+8wmdmV94nz3mLh5904pKMj67ABEBAAG0
Dmtra2trIDxrQGsua2s+iLgEEwECACIFAlUuNLcCGwMGCwkIBwMCBhUIAgkKCwQW
AgMBAh4BAheAAAoJEBreQ20puKF6AdMD/2mAaJJYBRdyZ6eDpldsAenkwVQoxDz8
a68auy9jLEA+jZH/y5pdlNGJ2uTUUdM00rYaV/oIzuxWLF1x7J8/qLD8rZQRKe3d
iKY6vq1L44cfmeSo5tN88h050fZCvqY+9sx3s1ubLztX5W8GzeDV0GBaORUulgwk