Skip to content

Instantly share code, notes, and snippets.

View yvesvanbroekhoven's full-sized avatar

Yves Van Broekhoven yvesvanbroekhoven

View GitHub Profile
@yvesvanbroekhoven
yvesvanbroekhoven / .phoenix.js
Last active February 10, 2020 08:26
Phoenix Window Manager configuration
/**
* Useful links:
*
* INSTALL:
* - https://github.com/kasper/phoenix#install
*
* API DOCS
* - https://github.com/kasper/phoenix/blob/master/docs/API.md
*
* EXAMPLE CONFIGURATIONS
@yvesvanbroekhoven
yvesvanbroekhoven / harvest-basecamp.js
Last active August 2, 2023 13:51
UserScript Harvest Basecamp
// ==UserScript==
// @name Basecamp
// @version 0.1
// @description try to take over the world!
// @author You
// @include https://basecamp.com/*
// @grant none
// ==/UserScript==
class BasecampHelpers {
@yvesvanbroekhoven
yvesvanbroekhoven / jquery-cm-ajax-form.js
Created May 4, 2018 09:58
jQuery Campaign Monitor Ajax form
(function($) {
var pluginName = 'cmAjaxForm';
$.fn.cmAjaxForm = function(callback) {
this.each(function() {
var $this = $(this);
if (!$this.data(pluginName)) {
$this.data(pluginName, new cmAjaxForm($this, callback));
}

Keybase proof

I hereby claim:

  • I am yvesvanbroekhoven on github.
  • I am yvb (https://keybase.io/yvb) on keybase.
  • I have a public key ASCNHWKXUeQ-pqk5iBdPetjo9NyvrtMWKJ63Yi4awVwraAo

To claim this, I am signing this object:

@yvesvanbroekhoven
yvesvanbroekhoven / bindArguments.js
Last active September 15, 2016 12:36
Bind arguments to a function
function Foo(x,y,z) {
bindArguments(this, arguments);
}
function bindArguments(ctx, args) {
var argumentNamesStr = /\((.*)\)/.exec(ctx.toString());
var argumentNames;
if (argumentNamesStr) {
argumentNames = argumentNamesStr[1].split(',');
@yvesvanbroekhoven
yvesvanbroekhoven / compass.rb
Created January 13, 2016 11:20
Compass not compiling anymore in older Rails projects?
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "public/stylesheets"
sass_dir = "app/assets/stylesheets"
http_images_dir = "images"
images_dir = "public/images"
# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed
output_style = environment == :production ? :compressed : :expanded
#
# Heroku pg:transfer shortcut
#
# Convention:
# - heroku app names end with -s for staging and -p for production (foo-s or foo-p)
# - local postgres db is named like client_appnamewithoutenv_development (client_foo_development)
#
# How to use:
# Place this in your ~/.bash_profile
# Go to a folder where heroku gem is installed

Loading Pages Via AJAX Into An Overlay

In order to do this we need a few things. These will be explained in detail later on.

  • The default content (the content which is there when closing the overlay)
  • The overlay content
  • A return path, i.e. the desired path when closing the overlay

TODO:

mike@rbci:~$ psql -U postgres
psql (9.0.3)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1