Skip to content

Instantly share code, notes, and snippets.

View dideler's full-sized avatar

Dennis Ideler dideler

View GitHub Profile
@dideler
dideler / setup.sh
Last active March 26, 2017 17:38
A basic script to configure my development environment on a new Ubuntu machine.
#!/bin/bash
#
# A basic script to configure a new personal machine and my development environment.
# Install: wget -q https://gist.github.com/dideler/6605525/raw/a5e83789254ee4c01937905a7398300386d2dd30/setup.sh -O - | sh
#
# Note that some stuff I use, such as fish, are typically installed via binaries.
#
# Don't forget to enable virtual desktops and two finger reverse scrolling!
# http://askubuntu.com/questions/260510/how-do-i-turn-on-workspaces-why-do-i-only-have-one-workspace-in-13-04
# http://askubuntu.com/questions/91426/reverse-two-finger-scroll-direction
@maxim
maxim / rails_load_path_tips.md
Last active January 9, 2025 00:59
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

@goatslacker
goatslacker / gist:6004481
Created July 15, 2013 23:36
time tracking local
" Lets me know how much time I've spent editing a file
" Keyboard shortcut -> \dt
augroup TimeSpentEditing
au!
au BufWinEnter * if !exists('b:tstart')|let b:tstart=reltime()|en
augroup END
function! TimeSpentEditing()
let secs = str2nr(reltimestr(reltime(b:tstart)))
let hours = secs / 3600
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@dideler
dideler / 0-startup-overview.md
Last active March 14, 2025 15:00
Startup Engineering notes
@dideler
dideler / inheritance.cpp
Last active August 9, 2024 12:25
C++ notes
class A
{
public:
int x;
protected:
int y;
private:
int z;
};
@dideler
dideler / _code_snippets.md
Last active January 6, 2024 15:11
Various snippets of code. Enjoy!

Snippets of code that I've played around with, which could be useful to others.
Nothing impressive, but you may learn a thing or two.

@dideler
dideler / Makefile
Last active April 8, 2024 04:16
An easy and quick way to encrypt (and decrypt) sensitive files on your computer. The filename is static, so don't forget to set it (on line 14)!
# Based on http://ejohn.org/blog/keeping-passwords-in-source-control/
#
# John Resig needed a way to keep sensitive data (e.g. config files with
# passwords) out of source control. So he decided to encrypt the sensitive data.
#
# I decided to modify the script so it's purpose is quickly encrypting or
# decrypting any sensitive file you have on your computer.
#
# Usage: make encrypt
# make decrypt
@dideler
dideler / example.md
Last active November 14, 2024 03:33
A python script for extracting email addresses from text files.You can pass it multiple files. It prints the email addresses to stdout, one address per line.For ease of use, remove the .py extension and place it in your $PATH (e.g. /usr/local/bin/) to run it like a built-in command.
@dideler
dideler / file_to_string.py
Created March 21, 2013 22:17
Playing around with different ways to read file contents into a string.
#!/usr/bin/env python
import sys
filename = sys.argv[1]
# These do not remove \n
with open(filename) as f:
s = ''.join(f.readlines())