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 Random { | |
public static void randomlyThrow() throws Exception { | |
if (Math.random() < 0.25) { | |
throw new Exception("Random!"); | |
} | |
} | |
public static void main(String[] args) { | |
int failures = 0; |
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! s:start_delete(key) | |
let l:result = a:key | |
if !s:deleting | |
let l:result = "\<C-G>u".l:result | |
endif | |
let s:deleting = 1 | |
return l:result | |
endfunction | |
function! s:check_undo_break(char) |
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
if (!window.getComputedStyle) { | |
window.getComputedStyle = (function() { | |
var // partially grabbed from jQuery and Dean's hack | |
notpixel = /^(?:[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/, | |
position = /^(top|right|bottom|left)$/, | |
re = /\-([a-z])/g, | |
place = function (match, $1) { | |
return $1.toUpperCase(); |
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
syntax on | |
set background=dark | |
set incsearch | |
set nohlsearch | |
set hidden |
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 | |
try | |
{ | |
include './index.php'; | |
} | |
catch (Exception $e) | |
{ | |
} |
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
#!/bin/bash | |
num=${1:-1} | |
git reset HEAD^${num} |
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! s:express(type) | |
let expression = input('=', '', 'expression') | |
let a_reg = @a | |
let selection = &selection | |
set selection=inclusive | |
let selectcmd = "`[v`]" | |
if a:type == 'line' | |
let selectcmd = "'[V']" | |
endif | |
execute 'normal!'.selectcmd.'"ay' |
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! s:sargs() | |
execute 'arglocal! '.join(map(tabpagebuflist(), 'bufname(v:val)'), ' ') | |
execute winnr().'argument' | |
execute 'only' | |
endfunction | |
command! Sargs call s:sargs() |
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
# Description: | |
# Issue various Git commands on remote servers | |
# | |
# Commands: | |
# Hubot create <type> repository <nickname> = <user>/<repository> - Define a repository for linking | |
# Hubot create server <nickname> - Define a new server | |
# Hubot set <property> on server <nickname> to <value> - Set a server's user, address, directory, or repo | |
# Hubot alias server <nickname> to <alias> - Create an alias to a server | |
# Hubot describe server <nickname> - Show details of a server | |
# Hubot delete server <nickname> - Delete server details |
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! MinCommandPrefix(command) | |
for i in range(len(a:command) - 1, 0, -1) | |
if exists(':' . strpart(a:command, 0, i)) != 1 | |
return i + 1 | |
endif | |
endfor | |
return -1 | |
endfunction |
NewerOlder