Skip to content

Instantly share code, notes, and snippets.

bind_search_license: function(){
$("#search-license").click(function(){
var t$ = $("#shop_license");
$.ajax({
type:'get',
dataType:'json',
url:'/auth/search_license',
cache:false,
data:{ license: t$.val() },
success: function(){
<?php
function normalize ($string) {
$table = array(
'Š'=>'S', 'š'=>'s', 'Đ'=>'Dj', 'đ'=>'dj', 'Ž'=>'Z', 'ž'=>'z', 'Č'=>'C', 'č'=>'c', 'Ć'=>'C', 'ć'=>'c',
'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',
'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O',
'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss',
'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e',
'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o',
" http://github.com/solars/github-vim/
" sol@textmode.at
if exists("loaded_github") || &cp
finish
endif
" --- main functions --- "
function! s:RelPath()
if !exists('b:rel_path')
let root = escape('$PWD')
let file = expand('%:p')
let b:rel_path = strpart(file,matchend(file, root))
endif
return b:rel_path
endfunction
# If X aka bomb is pressed then
if ig.input.state 'bomb'
console.log 'bombs away'
@cj
cj / vimrc
Created December 29, 2010 17:01
" Press ,v to edit vimrc
let mapleader = ","
nmap <leader>v :tabedit $MYVIMRC<CR>
_.mixin
array_shift: (inputArr) ->
props = false
shift = undefined
pr = ''
allDigits = /^\d$/
int_ct = -1
_checkToUpIndices = (arr, ct, key) ->
#Deal with situation, e.g., if encounter index 4 and try to set it to 0, but 0 exists later in loop (need to
#increment all subsequent (skipping current key, since we need its value below) until find unused)
array_shift: (inputArr) ->
if inputArr.length is 0 then null
if inputArr.length > 0 then _.array_shift(inputArr)
name= if previous_keys.length > 0
then "#{main_key}[#{_.implode('][', previous_keys)}][#{key}]"
else "#{main_key}[#{key}]"
if previous_keys.length
name= "#{main_key}[#{_.implode('][', previous_keys)}][#{key}]"
else
name= "#{main_key}[#{key}]"