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
public class Exercises { | |
public static void main(String[] args) { | |
/* | |
1. 4 birds are sitting on a branch. 1 flies away. How many birds are left on | |
the branch? | |
*/ | |
/* |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os | |
import re | |
import sublime | |
import sublime_plugin | |
class KeepCentered(sublime_plugin.EventListener): | |
def on_modified_async(self, view): |
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
function generateRandomString($length = 15) | |
{ | |
return substr(sha1(rand()), 0, $length); | |
} |
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
<?php | |
/* | |
Plugin Name: User Agents | |
Plugin URI: https://gist.github.com/firstclown/ | |
Description: Shows User Agents on the Traffic Location page | |
Version: 1.0 | |
Author: firstclown | |
Author URI: http://www.jerickson.net/ | |
*/ |
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
jQuery.fn.extend({ | |
insertAtCaret: function(myValue){ | |
return this.each(function(i) { | |
if (document.selection) { | |
//For browsers like Internet Explorer | |
this.focus(); | |
var sel = document.selection.createRange(); | |
sel.text = myValue; | |
this.focus(); | |
} |
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
message.replace(/\n([ \t]*\n)+/g, '</p><p>').replace(/\n/g, '<br />'); |
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
function sl | |
if test (count $argv) -eq 0 | |
set argv[1] '.' | |
end | |
subl -n $argv | |
end |
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
function generate_book | |
multimarkdown $argv[1].md -o story.html | |
kindlegen assembly.opf -o $argv[1].mobi | |
ebook-convert $argv[1].mobi $argv[1].epub --page-breaks-before=/ | |
end |
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
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'securerandom' | |
require 'fileutils' | |
require 'erb' | |
params = {} | |
target_directory = "New" | |
# Parse args |
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
var id = Math.random().toString(16).slice(2) |
NewerOlder