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
# Aliases for NeoVim | |
alias vim="nvim" | |
alias vi="nvim" | |
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " | |
# Set CLICOLOR if you want Ansi Colors in iTerm2 | |
export CLICOLOR=1 | |
# Set colors to match iTerm2 Terminal Colors |
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
import os | |
import sys | |
import gzip | |
import re | |
except_match = re.compile(r'^(?!.*Werror).*(?:exception|error|warning|Segmentation)') | |
def has_exception(content): | |
return except_match.search(content) |
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
{ | |
"workbench.startupEditor": "newUntitledFile", | |
"workbench.colorTheme": "Dracula", | |
"files.associations": { | |
"*.jinja": "html" | |
}, | |
"workbench.editor.enablePreview": false, | |
"editor.tabSize": 4, | |
"editor.insertSpaces": true, | |
"editor.detectIndentation": true, |
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
def pretty_request(request): | |
headers = '' | |
for header, value in request.META.items(): | |
if not header.startswith('HTTP'): | |
continue | |
header = '-'.join([h.capitalize() for h in header[5:].lower().split('_')]) | |
headers += '{}: {}\n'.format(header, value) | |
return ( | |
'{method} HTTP/1.1\n' |
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
set nocompatible " required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" let Vundle manage Vundle, required | |
Plugin 'gmarik/Vundle.vim' |
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
SET @count = 0; | |
UPDATE `users` SET `users`.`id` = @count:= @count + 1; | |
ALTER TABLE `users` AUTO_INCREMENT = 1; |
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
$.ajax({ | |
url: 'submit.php', | |
data: $(this).serialize(), | |
type: 'POST', | |
dataType: 'json', | |
success: function(data) { | |
if (data.status == 0) { | |
alert('You are offline!\nPlease check your network connection.'); | |
} else if (data.status == 404) { | |
alert('Requested URL not found.'); |