Skip to content

Instantly share code, notes, and snippets.

View jwilm's full-sized avatar

Joe Wilm jwilm

View GitHub Profile
@cjohansen
cjohansen / gist:739589
Created December 13, 2010 20:55
Showing how to fake server requests with Sinon.JS and Jasmine
/*
Load Sinon.JS in the SpecRunner:
<script type="text/javascript" src="lib/jasmine-1.0.1/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.0.1/jasmine-html.js"></script>
<script type="text/javascript" src="sinon-1.0.0.js"></script>
<script type="text/javascript" src="sinon-ie-1.0.0.js"></script>
http://cjohansen.no/sinon/
*/
@OrangeTux
OrangeTux / config
Last active June 19, 2021 13:18
Config for Irssi to connect to various XMPP chat servers. Replace the passwords, usernames an ids by your own. Remember, the irssi-xmpp (http://cybione.org/~irssi-xmpp/) plugin is requried.
# irssi-xmpp plugin required
# http://cybione.org/~irssi-xmpp/
servers = (
{
address = "chat.facebook.com";
chatnet = "facebook";
password = "<password>";
autoconnect = "true";
},
{
@maxim
maxim / rails_load_path_tips.md
Last active April 13, 2023 13:28
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/

@synaptiko
synaptiko / 01-how-to-modify-physical-display-size-in-edid.md
Last active June 6, 2023 09:51
How to modify physical display size in EDID (on ArchLinux with systemd boot)

How to modify physical display size in EDID

Following method describes how to fix EDID display size information of your monitor if it's wrong (some of Samsung's monitors report incorrect size when connected over HDMI, for example). It assumes that your monitor is connected to HDMI1 port (HDMI-A-1 is full kernel address).

I used following tools:

@Determinant
Determinant / xim_example.c
Last active October 9, 2023 13:54
A minimal example for X Input Method.
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <stdlib.h>
#include <stdio.h>
#include <locale.h>
#include <assert.h>
Display *dpy;
Window win;
@NoobsArePeople2
NoobsArePeople2 / gist:5121597
Last active November 10, 2023 14:33
Configure media keys on a non-Apple keyboard to control Spotify via AppleScript and USB Overdrive on OSX.

Requirements

  1. USB Overdrive
  2. A non-Apple keyboard with media keys (or keys you want to make "media" keys). For reference, I'm using a Microsoft Sidewinder X4

Set Up

  1. Plug in your keyboard and install USB Overdrive.
  2. Open USB Overdrive. Click into the Settings tab.
  3. Click the dropdown and select "Any Keyboard, Any Application"
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.