Skip to content

Instantly share code, notes, and snippets.

View dideler's full-sized avatar

Dennis Ideler dideler

View GitHub Profile
@chrismdp
chrismdp / unsplash.sh
Last active December 28, 2015 17:17
Script to grab one of the 10 more recent images from Unsplash, and tint and blur it for use as an iTerm background using Solarized Dark
#!/bin/bash
# NOTE: requires ImageMagick
# NOTE: will tint to the Solarized Dark default background scheme, as the iTerm background blend option didn't lower the contrast enough for me
# NOTE: Optimised for a 1280x800 point screen (my 13" Retina MBP)
set -e
index=$[ 1 + $[ RANDOM % 10 ]]
img=`curl https://unsplash.com/rss/ | xmllint --xpath '/rss/channel/item['$index']/image/url/text()' -`
curl "$img" > ~/unsplash-latest.jpg &&
@mattscilipoti
mattscilipoti / pre-push.sh
Last active January 3, 2016 06:39 — forked from pixelhandler/pre-push.sh
pre-push script: Protects some branches from destructive actions.
#!/usr/bin/env ruby
# NOTE! this is a work in progress. This is not tested or used regularly.
# Ensures we do not call destructive commands on protected branches.
#
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
@martindale
martindale / CONTRIBUTING.md
Created January 22, 2014 20:56
example CONTRIBUTING.md

Contributing to this Project

Here's how you can help.

Process

In the spirit of openness, this project follows the Forking Flow, a derivative of the Gitflow model. We use Pull Requests to develop conversations around ideas, and turn ideas into actions.

Some PR Basics

  • Anyone can submit a Pull Request with changes they'd like to see made.
  • Pull Requests should attempt to solve a single [1], clearly defined problem [2].
  • Everyone should submit Pull Requests early (within the first few commits), so everyone on the team is aware of the direction you're taking.
# Other syntax without patch
STUDENT_LEVELS = {
freshman: Student::Underclassman,
sophomore: Student::Underclassman,
junior: Student::Upperclassman,
senior: Student::Upperclassman,
graduate: Student::Graduate
}.tap { |h| h.default = Student::Unregistered }
@nebiros
nebiros / unicorn.rake
Created June 5, 2012 17:26
rails rake tasks for managing unicorn server instances + rbenv
ENV["RAILS_ENV"] ||= "production"
module UnicornServer
# http://unicorn.bogomips.org/Unicorn/Configurator.html
CONFIG_PATH = File.join(Rails.root, "config", "unicorn.rb")
PID_PATH = File.join(Rails.root, "tmp", "pids", "unicorn.pid")
RBENV = %x[which rbenv].strip
DAEMON = "bundle exec unicorn_rails"
DAEMON_OPTS = "-c #{CONFIG_PATH} -E #{ENV["RAILS_ENV"]} -D"
@dideler
dideler / twitter-gadget-instructions.md
Last active August 29, 2016 03:08
Twitter Gadget for Google Sites

How to display a Twitter feed on your Google Site

A short tutorial for creating a Twitter gadget for Google Sites that will display tweets from a user or search.

Problem

Displaying Twitter tweets on your Google Sites website is difficult!
Google Sites filters your HTML code and doesn't allow you to add your own JavaScript code, therefore restricting you from adding any of the many existing Twitter widgets that exist today, including Twitter's very own.

The Google Gadgets directory contains a Twitter gadget called Twit. This is the gadget I was using in the past.

@dideler
dideler / inheritance.cpp
Last active March 20, 2017 21:13
C++ notes
class A
{
public:
int x;
protected:
int y;
private:
int z;
};
@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
@arirusso
arirusso / video-capture-example.rb
Created March 28, 2012 00:36
ruby-processing: video capture processing example
#!/usr/bin/env ruby
# this is a test of ruby-processing (https://github.com/jashkenas/ruby-processing) with video capture
# use "rp5 unpack library" at a command line to install the video library, among others
# tested with Ruby 1.9.2 on OSX with built in web cam
class VideoCaptureTest < Processing::App