Skip to content

Instantly share code, notes, and snippets.

@dustinmartin
dustinmartin / hello.cfm
Created April 13, 2010 00:32
A Gist example for a few languaes I use
<cfset greeting = "Hello World">
<cfoutput>#greeting#</cfoutput>
Application.init("MyApplication", function(Core){
Core.loadConfig({
enableLogging: true,
handleErrors: true
});
Core.sandbox.addExtension("sayHello",function(){
alert("Hey there!");
);
@dustinmartin
dustinmartin / gist:947636
Created April 29, 2011 00:36
Populate Method for CF9 ORM
<cfscript>
public void function populate(required struct memento,
boolean trustedSetter=false,
string include="",
string exclude="",
string disallowConversionToNull=""){
var object = this;
var key = "";
var populate = true;
@dustinmartin
dustinmartin / gist:1901639
Created February 24, 2012 15:29 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@dustinmartin
dustinmartin / gist:1942730
Created February 29, 2012 17:27
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
#! /usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Traverse a directory tree, picking embedded pictures from .MP3 and .M4A audio
# saving them to a “cover.{png,jpg,bmp}” (as long as the file does *not* exist)
# and then removing the embedded pictures from the audio file.
#
# Requires the Mutagen tag edition library: https://code.google.com/p/mutagen/
# Most distributions ship in a package called “python-mutagen“.
#
@dustinmartin
dustinmartin / gist:2966397
Created June 21, 2012 15:31
Git Command Cheatsheet
Setup
-----
git clone <repo>
clone the repository specified by <repo>; this is similar to "checkout" in
some other version control systems such as Subversion and CVS
Add colors to your ~/.gitconfig file:
[color]
"use strict";
app.directive( "invScreenUploader", function() {
function link( scope, element, attrs ){
// URL is undefined initially but eventually gets defined
console.log( attrs.url );
// These get defined in immediately
describe("MyApp", function() {
beforeEach(function() {
browser().navigateTo("../../index.html");
});
it("should be at /quote", function() {
browser().navigateTo('#!/quote');
expect( browser().location().url() ).toBe("/quote");
});
@dustinmartin
dustinmartin / obsidian-web-clipper.js
Created May 28, 2024 02:19 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */