Skip to content

Instantly share code, notes, and snippets.

View rchrand's full-sized avatar

Rune Andersen rchrand

View GitHub Profile
@rchrand
rchrand / gist:3731814
Created September 16, 2012 09:47
Java - int min
public int min(){
int minimum = list.get(0);
for (int i: list){
if (i <= minimum) {
minimum = i;
}
}
return minimum;
}
from Monster import Monster
from Person import Person
import random
from sys import exit
#class Person(object):
# def __init__(self, name):
# self.name = name
# self.life = 100
@rchrand
rchrand / style.css
Created November 12, 2012 16:25
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My website!</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description"
content="Placeholder, Placeholder" />
<meta name="keywords" content="Placeholder, placeholder" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
@rchrand
rchrand / xkcd.py
Created February 12, 2013 11:15
Xkcd comic script
from bs4 import BeautifulSoup
import requests
import os
images = []
final = ""
r = requests.get('http://xkcd.com/')
soup = BeautifulSoup(r.content)
@rchrand
rchrand / JP.java
Created February 25, 2013 09:40
Java searching recursive
public class SearchSize extends SwingWorker<Long, Long> {
private String currentPath;
private JLabel lblSize;
private long totalSize = 0;
public SearchSize(String path, JLabel lblSize){
this.currentPath = path;
this.lblSize = lblSize;
}
@rchrand
rchrand / package.json
Created May 16, 2013 15:02
JSON: Test
{
"name": "bootstrap"
, "description": "Sleek, intuitive, and powerful front-end framework for faster and easier web development."
, "version": "2.3.1"
, "keywords": ["bootstrap", "css"]
, "homepage": "http://twitter.github.com/bootstrap/"
, "author": "Twitter Inc."
, "scripts": { "test": "make test" }
, "repository": {
"type": "git"
@rchrand
rchrand / .Xdefaults
Created May 27, 2013 21:15
Dotfiles for Tmux, Vim, Xdefaults and Zsh
#define S_base03 #002b36
#define S_base02 #073642
#define S_base01 #586e75
#define S_base00 #657b83
#define S_base0 #839496
#define S_base1 #93a1a1
#define S_base2 #eee8d5
#define S_base3 #fdf6e3
#define S_yellow #b58900
#define S_orange #cb4b16
@rchrand
rchrand / index.html
Last active December 20, 2015 11:09
Handlebars Problem
<!doctype html>
<html>
<head>
<title>Rettiwt</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/stylecss.css">
</head>
<body>
<h1>Rettiwit</h1>
<div id="content">
@rchrand
rchrand / .emacs
Created August 6, 2013 12:33
my dot .emacs file
;;; Packages manager for Emacs
(require 'package)
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
;;;
;;; Keybindings
(global-set-key [(f5)] 'ack)
(global-set-key (kbd "C-x ;") 'kill-some-buffers)
(define-key global-map (kbd "RET") 'newline-and-indent) ; When pressing RET (Enter) makes a new line and ident it
@rchrand
rchrand / index.html.erb
Created September 24, 2013 21:20
Rails problems
<h1>Welcome to INDEX! </h1>
<% @user.each do |m| %>
<p>Email: <%= m.email %></p>
<br />
<% end %>