Skip to content

Instantly share code, notes, and snippets.

View amackera's full-sized avatar
💭
Hack and /

Anson MacKeracher amackera

💭
Hack and /
View GitHub Profile
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active June 28, 2024 10:38
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@simonwhitaker
simonwhitaker / postcode-regex.js
Last active December 15, 2023 11:29
An example of using a simplified UK postcode regex in Javascript
var tweet = "Currently chilling out at W1B 2EL, then on to WC2E 8HA or maybe even L1 8JF! :-)";
// Here's a simple regex that tries to recognise postcode-like strings.
// See http://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom#Validation
// for the rules on how UK postcodes are formatted.
var postcode_regex = /[A-Z]{1,2}[0-9][0-9A-Z]?\s?[0-9][A-Z]{2}/g;
var postcodes = tweet.match(postcode_regex);
console.log(postcodes);
@jsutlovic
jsutlovic / Asterank_test.kml
Last active December 16, 2015 11:19
Asterank KML test
<?xml version="1.0" encoding="UTF-8"?>
<kml hint="target=sky" xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2">
<Document>
<Placemark>
<name>Some asteroid</name>
<Point>
<coordinates>2.207589,-5.661244,0</coordinates>
</Point>
</Placemark>
<GroundOverlay>
@leshy
leshy / export-testingfw.js
Created February 14, 2012 15:07
selenium ide custom export
function parse(testCase, source) {
}
function format(testCase, name) {
var result = 'ctx.local.c\n';
var commands = testCase.commands;
for (var i = 0; i < commands.length; i++) {
var command = commands[i];
if (command.type == 'command') {
#!/bin/sh
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
usage=$(
cat <<EOF
$0 [OPTIONS] start/stop
-s set speed default 256Kbit/s
-p set port default 3000
-d set delay default 350ms
@takinbo
takinbo / paginated_collection.js
Created July 25, 2011 21:57 — forked from io41/paginated_collection.js
Pagination with Backbone.js & django-tastypie
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage', 'filtrate', 'sort_by');
typeof(options) != 'undefined' || (options = {});
typeof(this.limit) != 'undefined' || (this.limit = 20);
typeof(this.offset) != 'undefined' || (this.offset = 0);
typeof(this.filter_options) != 'undefined' || (this.filter_options = {});
typeof(this.sort_field) != 'undefined' || (this.sort_field = '');
@taxilian
taxilian / ImageDraw.cpp
Created July 6, 2011 21:21
Example windows image draw function for FireBreath
void PluginObject::drawImage(FB::PluginWindow *wnd, FB::PluginEvent* evt, unsigned char *img, int width, int height) {
HDC hdc=NULL;
BITMAPINFO bitmapInfo;
bitmapInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
bitmapInfo.bmiHeader.biBitCount=32;
bitmapInfo.bmiHeader.biCompression=BI_RGB;
bitmapInfo.bmiHeader.biPlanes = 1;
bitmapInfo.bmiHeader.biSizeImage = width*height*4;
bitmapInfo.bmiHeader.biWidth = width;
@rcmachado
rcmachado / html5.vim
Created December 15, 2009 10:35
Vim syntax file for HTML 5
" Vim syntax file
" Language: HTML (version 5)
" Maintainer: Rodrigo Machado <rcmachado@gmail.com>
" URL: http://gist.github.com/256840
" Last Change: 2010 Aug 26
" License: Public domain
" (but let me know if you liked it :) )
"
" Note: This file just adds the new tags from HTML 5
" and don't replace default html.vim syntax file
@henrik
henrik / .bashrc
Created December 3, 2008 17:56
Git branch and dirty state in Bash prompt.
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"