Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add / Update a key-value pair in the URL query parameters | |
function updateUrlParameter(uri, key, value) { | |
// remove the hash part before operating on the uri | |
var i = uri.indexOf('#'); | |
var hash = i === -1 ? '' : uri.substr(i); | |
uri = i === -1 ? uri : uri.substr(0, i); | |
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); | |
var separator = uri.indexOf('?') !== -1 ? "&" : "?"; | |
if (uri.match(re)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Injectable} from '@angular/core'; | |
// Declare TabsService as a provider in app.module.ts | |
// Inject TabsService in your class: constructor(public tabs: TabsService){} | |
// Use the this.tabs.hide() or this.tabs.show() methods wherever you want | |
@Injectable() | |
export class TabsService { | |
constructor() {} | |
public hide() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BLACK => "\033[30m", | |
RED => "\033[31m", | |
GREEN => "\033[32m", | |
YELLOW => "\033[33m", | |
BLUE => "\033[34m", | |
PURPLE => "\033[35m", | |
CYAN => "\033[36m", | |
WHITE => "\033[37m", | |
# background color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From http://stackoverflow.com/questions/3583989/jquery-autocomplete-pass-targeted-element-attribute-as-an-extra-parameter | |
$("#autocomplete input").each(function() { | |
var that = this; | |
$(that).autocomplete({ | |
source: function(request, response) { | |
$.ajax({ | |
url: "search.php", | |
dataType: "json", | |
data: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rstakeout_model_spec() | |
{ | |
rstakeout "script/spec spec/models/$1_spec.rb $2" "app/models/*.rb" "spec/models/$1_spec.rb" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<gpx version="1.1" | |
creator="GMapToGPX 6.4b - http://www.elsewhere.org/GMapToGPX/" | |
xmlns="http://www.topografix.com/GPX/1/1" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"> | |
<rte> | |
<name>Gmaps Pedometer Route</name> | |
<cmt>Permalink: <![CDATA[ | |
Permalink unavailable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0,15,30,45 * * * * /Users/andrew/bin/start_cijoe > /dev/null 2>&1 | |
0,15,30,45 * * * * /Users/andrew/bin/start_cijoe_tunnel > /dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is bloody ugly, but it works! Hooray! | |
// One of the early NEHE tutorials, compiled using: | |
// gcc -framework GLUT -framework OpenGL triangle_square_colour_rotate.c -o triangle_square_colour_rotate -Wall | |
#include <stdio.h> | |
#ifdef __APPLE__ | |
#include <GLUT/glut.h> | |
#else | |
#include <GL/glut.h> /* glut.h includes gl.h and glu.h*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add the following to your .bash_profile for auto-completion | |
# (e.g. mvimgem <tabtab>) | |
# | |
# Modified to work with mvim instead of Textmate | |
# Original: http://effectif.com/articles/opening-ruby-gems-in-textmate | |
_mvimgem() | |
{ | |
local curw | |
COMPREPLY=() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/script ChatThrottleLib:SendChatMessage('BULK', 'paromoan', 'Raid roll numbers:', 'RAID') for ii=1,GetNumRaidMembers(),1 do local n=GetRaidRosterInfo(ii);ChatThrottleLib:SendChatMessage('BULK','paromoan', ('' .. ii .. '. ' .. n), 'RAID') end |
NewerOlder