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
// App.js | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Provider } from 'react-redux'; | |
import WishlistApp from './wishlist/App'; | |
import VisaCheckerApp from './visa-checker/App' | |
import TripSearchApp from './trip-search/App' | |
import { store } from './store' | |
const WishlistDOM = document.getElementById('wishlist-app') |
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
SELECT query, calls, total_time, rows, | |
100.0 * shared_blks_hit / nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent | |
FROM pg_stat_statements ORDER BY total_time DESC LIMIT 100; |
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
for f in `git diff master --name-only`; do cp $f `echo $f | sed -E 's/\.(scss|html)/-v2.\1/'` ; done |
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 | |
# This hook is sourced after every virtualenv is activated. | |
# Added to $WORKON_HOME/.virtualenvs/postactivate | |
# color virtualenv name properly and put it after the \n if there is one at the start of the prompt | |
if [ ${_OLD_VIRTUAL_PS1:0:2} == '\n' ]; then | |
PS1="\n\[\033[$PROMPT_COLOR1\](`basename \"$VIRTUAL_ENV\"`) ${_OLD_VIRTUAL_PS1:2:${#_OLD_VIRTUAL_PS1}}" | |
else | |
PS1="\[\033[$PROMPT_COLOR1\](`basename \"$VIRTUAL_ENV\"`) $_OLD_VIRTUAL_PS1 " |
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 | |
flags="" | |
extension="py" | |
search_term="" | |
verbose="" | |
help_str="\n\tmygrep [-f|--flags flags] [-v|--verbose] [-x|--ext extension]\n" | |
if [ $# -eq 0 ]; then |
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
# .tmux.conf | |
# set leader to capslock (need to disable capslock functionality first) | |
set-option -g prefix F10 | |
# allow double click on session to switch | |
set -g mouse-select-pane on | |
# allow vi like functionality (key for copy pasting) | |
set -g mode-keys vi |
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
%s/@[^@#]*#egg/#egg/g |
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
{k: v for k,v in locals().iteritems() if '__' not in k and 'pdb' not in k} |
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
# 0 is too far from ` ;) | |
set-option -g prefix F10 | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi |
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
# Do a load of inline edits using grep instead of perl | |
for d in $(grep -rl "from conf.cache_times" *); do sed -i '' 's/from conf.cache_times/from sites.conf.cache_times/g' $d; done | |
# Rename a load of directories from the command line | |
for d in $(find . -name 'migrations' -type d); do mv $d $(echo $d | sed 's/migrations/south_migrations/' | sed 's/\.\///g'); done | |
# Running a series of makemigrations on the apps found that do not already have migrations | |
for d in $(find . -type d -maxdepth 1); do if [ ! -d "$d/migrations" ]; then python manage.py makemigrations $(echo $d | sed 's/\.\///'); fi; done | |
# using awk - get stuff between double quotes |
NewerOlder