Skip to content

Instantly share code, notes, and snippets.

@chuckha
chuckha / license_generator.vim
Created April 4, 2012 13:15 — forked from meirish/license_generator.vim
License Generator for SBO projects
function! LicenseGenerator()
let date = strftime("%c")
if &ft == "javascript"
return "/*jslint bitwise: true, browser: true, eqeqeq: true, immed: true, newcap: true, regexp: true, nomen: false, onevar: false, undef: true, plusplus: false, white: true, indent: 2 */\n/*global confirm define interpolate gettext console */\n\n// Created by Matthew Irish ([email protected]) on " . date . "\n/*! Copyright (c) 2012 Safari Books Online, LLC. All rights reserved.*/\n\n"
endif
if &ft == "python"
return "# encoding: utf-8\n\n# Created by Chuck Ha ([email protected]) on" . date . "\n# Copyright (c) 2012 Safari Books Online, LLC. All rights reserved.\n\n"
endif
endfun
@chuckha
chuckha / license_generator.vim
Created April 3, 2012 19:18
License Generator for SBO projects
function! LicenseGenerator()
let date = strftime("%c")
call search("# encoding: utf-8")
return "# Created by Chuck Ha on " . date . "\n# Copyright (c) 2012 Safari Books Online, LLC. All rights reserved.\n\n"
endfun
nmap <silent> ,li "=LicenseGenerator()<CR>p
@chuckha
chuckha / lightsout_example.js
Created February 18, 2012 01:26
javascript string and integer addition/concatenation
// The first three are strings, the last is a number
"1" + "2" = "12";
"1" + 2 = "12";
1 + "2" = "12";
1 + 2 = 3;
// These are all numbers
"1" - 2 = -1;
"1" - "2" = -1;
1 - "2" = -1;