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
#include <bits/stdc++.h> | |
using namespace std; | |
int solution(vector<int> arr, int days_til_exam) { | |
// number of chapters | |
int n_chaps = arr.size(); | |
// longest chapter | |
int m = *max_element(arr.begin(), arr.end()); |
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 | |
cd "$(dirname "$0")" | |
rsync_cmd="rsync --archive --verbose" | |
# Determine if `--dry-run` | |
real=0 | |
for var in "$@" |
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
defshell -bash | |
hardstatus alwayslastline | |
hardstatus string '%{= kw}%-w%{= BW}%50>%n %t%{= kw}%+w%<' | |
shelltitle "" | |
multiuser off | |
vbell_msg "Beep!" | |
startup_message off | |
defscrollback 40000 | |
#terminfo and termcap for nice 256 color terminal | |
# allow bold colors - necessary for some reason |
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
syntax on |
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
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" | |
[[ -r "/usr/local/etc/bash_completion.d/python-argcomplete" ]] && . "/usr/local/etc/bash_completion.d/python-argcomplete" | |
_ssh() | |
{ | |
local cur prev opts | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
opts=$(grep '^Host' ~/.ssh/config ~/.ssh/config.d/* 2>/dev/null | grep -v '[?*]' | cut -d ' ' -f 2-) |
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
# autoload -Uz compinit | |
# compinit | |
# [[ -r "/usr/local/etc/bash_completion.d/python-argcomplete" ]] && . "/usr/local/etc/bash_completion.d/python-argcomplete" | |
# eval "$(register-python-argcomplete /Users/shane/nutra/cli/nutra)" | |
alias grep='ggrep --color' | |
export GPG_TTY=$(tty) |
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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/Users/shane/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME | |
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes |
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
class Node: | |
def __init__(self, parent_id, id, name): | |
self.id = id | |
self.parent_id = parent_id | |
self.name = name | |
self.children = [] | |
def printChildren(node, level=1): | |
for c in node.children: |
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
.headers on | |
.mode column | |
PRAGMA foreign_keys = 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
#!/bin/bash | |
# # compx Left Hand | |
# xinput set-prop "pointer:Compx 2.4G Receiver Mouse" 322 1 | |
# logitech Left Hand | |
xinput set-prop "Logitech USB Trackball" 328 1 | |
# logitech Scroll Enabled | |
xinput set-prop "Logitech USB Trackball" 317 0 0 1 | |
# logitech Scroll Button |
NewerOlder