This file contains hidden or 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
# Wait on all child jobs. | |
function wait_jobs () { | |
for PID in $(jobs -p); do | |
notice "Waiting on pid $PID" | |
wait $PID | |
done | |
} |
This file contains hidden or 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
"------------------------------------------------------------------------------- | |
" Vim Initial Setup | |
"------------------------------------------------------------------------------- | |
" init vim-pathogen | |
execute pathogen#infect() | |
set nocompatible | |
filetype off |
This file contains hidden or 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 | |
PIP="$PYTHONPATH/pip $1" | |
# add target dir for install and uninstall | |
[[ "$1" = *install ]] && PIP="$PIP -t $PYTHONPATH" | |
# remove first arg since it is in $PIP | |
shift |
This file contains hidden or 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
def fuzz_bizz (start, finish, fizz_denominator=3, buzz_denominator=5): | |
for i in range(start, finish+1): | |
output = '' | |
if i % fizz_denominator is 0: | |
output += "Fizz" | |
if i % buzz_denominator is 0: | |
output += "Buzz" | |
if output is '': |
This file contains hidden or 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
server { | |
listen 8118; | |
server_name website.com www.website.com; | |
root /var/www/website/www; | |
expires 1M; | |
# route requests to front controller | |
location / { | |
rewrite ^(.+)$ /index.php?__rlquery=$uri last; |
This file contains hidden or 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
diff --git a/lib/elements/model/database.py b/lib/elements/model/database.py | |
index a563906..87b9094 100644 | |
--- a/lib/elements/model/database.py | |
+++ b/lib/elements/model/database.py | |
@@ -538,11 +538,16 @@ class DatabaseModel: | |
if key == meta.primary_key or key in meta.model.Meta.read_only: | |
continue | |
+ if key == "key": | |
+ key = "`key`" |
This file contains hidden or 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 | |
class MusicSearch { | |
// ----------------------------------------------------------------------------------------------------------------- | |
// CONSTANTS | |
// ----------------------------------------------------------------------------------------------------------------- | |
// categories options | |
const CATEGORY_ALBUM = 1; |
This file contains hidden or 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
" Swap window buffers. | |
function! SwapWindowBuffers() | |
if !exists("g:markedWinNum") | |
" set window marked for swap | |
let g:markedWinNum = winnr() | |
:echo "window marked for swap" | |
else | |
" mark destination | |
let curNum = winnr() | |
let curBuf = bufnr( "%" ) |
This file contains hidden or 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: update_article_fts_index() | |
-- DROP FUNCTION update_article_fts_index(); | |
CREATE OR REPLACE FUNCTION update_article_fts_index() | |
RETURNS trigger AS | |
$BODY$ | |
BEGIN | |
-- Update the fts_index | |
NEW.fts_index = |
This file contains hidden or 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
" Swap window buffers. | |
function! SwapWindowBuffers() | |
if !exists("g:markedWinNum") | |
" set window marked for swap | |
let g:markedWinNum = winnr() | |
:echo "window marked for swap" | |
else | |
" mark destination | |
let curNum = winnr() | |
let curBuf = bufnr( "%" ) |