Skip to content

Instantly share code, notes, and snippets.

View wrick17's full-sized avatar
🎯
Focusing

Pratyush Poddar wrick17

🎯
Focusing
View GitHub Profile
@wrick17
wrick17 / Default (Linux).sublime-keymap
Last active August 29, 2015 14:16
sublime settings preferences
[
{ "keys": ["ctrl+shift+f"], "command": "reindent", "args": {"single_line": false} },
{ "keys": ["ctrl+shift+space"], "command": "afn_show_filenames",
"context":
[
{ "key": "afn_use_keybinding", "operator": "equal", "operand": true }
]
},
{ "keys": ["ctrl+shift+j"], "command": "json_reindent"},
{ "keys": ["ctrl+alt+shift+j"], "command": "jsbeautify"},
@wrick17
wrick17 / .zshrc
Last active August 29, 2015 14:20
zsh config
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="josh"
# Uncomment the following line to use case-sensitive completion.
@wrick17
wrick17 / dark-vegas.zsh-theme
Created May 7, 2015 12:52
Dark Vegas Zsh Theme
function get_pwd() {
echo "${PWD/$HOME/~}"
}
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)⁣⁣⁣$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
function put_spacing() {
local git=$(git_prompt_info)
if [ ${#git} != 0 ]; then
@wrick17
wrick17 / object_compare.js
Created April 3, 2017 15:34
Gist file for comparing two objects
function deepCompare () {
var i, l, leftChain, rightChain;
function compare2Objects (x, y) {
var p;
// remember that NaN === NaN returns false
// and isNaN(undefined) returns true
if (isNaN(x) && isNaN(y) && typeof x === 'number' && typeof y === 'number') {
return true;
@wrick17
wrick17 / ohmyzsh-google-drive-sync.sh
Last active July 19, 2018 08:41 — forked from robbyrussell/ohmyzsh-dropbox-sync.sh
Keep your @ohmyzsh ~/.zshrc in sync via Google Drive
# Was asked how I keep my zshrc config sync'd between my computers with Google Drive
# Add a new directory in your Google Drive (or use an existing one)
mkdir -p ~/Google\ Drive/Mac
ln -s ~/Google\ Drive/Mac/.zshrc ~/.zshrc
# move existing file to Google Drive
mv ~/.zshrc ~/Google\ Drive/Mac
# symlink file back to your local directory
@wrick17
wrick17 / dark_slack.sh
Created October 15, 2018 11:44
Make slack dark (ONLY FOR OSX)
#! /bin/bash
# Don't want to interpret variables whilst reading from the HEREDOC - thus the single quotes... potto
cat << 'EOF' >> /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
document.addEventListener('DOMContentLoaded', function() {
$.ajax({
url: 'https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css',
success: function(css) {
$("<style></style>").appendTo('head').html(css);
}
# Local ngnix server for mac to have subroutes to your localhost domain
# With this, if you hit http://localhost/food, it'll load localhost:8580 on that route.
# /usr/local/etc/nginx/nginx.conf
http {
server {
listen 80;
server_name localhost;
location /food/ {