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 | |
usage() { | |
echo "usage: $(basename $0) github-user github-repository" | |
echo " $(basename $0) github-user/github-repository" | |
} | |
if [[ "$#" -ne 1 && "$#" -ne 2 ]]; then # require exactly 1 or 2 arguments | |
usage && exit | |
elif [[ "$#" -eq 1 && "$1" != *"/"* ]]; then # if one argument provided, require a slash |
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 | |
for filepath in $@; do | |
if [[ -f "$filepath" ]]; then | |
filepath_bak=$filepath.bak | |
if [[ -f "$filepath_bak" ]]; then | |
i=1 | |
filepath_bak_i=$filepath_bak".$i" | |
while [[ -f "$filepath_bak_i" ]]; do | |
((i++)) |
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
#!/usr/bin/env python3 | |
import re | |
import os | |
import sys | |
import time | |
import hashlib | |
import optparse | |
parser = optparse.OptionParser() |
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
#!/usr/bin/env python3 | |
import sys | |
import time | |
import socket | |
import _thread | |
import readline | |
if len(sys.argv) < 3: | |
print('usage: pysock [options] server port') |
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 path in "$@"; do | |
# Get the mime-type | |
MIMETYPE=$(file --mime-type -b "$path") | |
if [[ "$MIMETYPE" == "image/jpeg" ]]; then | |
# Use jp2a if image is jpg | |
jp2a "$path" | |
elif [[ "$MIMETYPE" =~ image/* ]]; then | |
# Convert image to temporary jpg | |
TMPPATH="/tmp/.$path.jpg" |
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 | |
# A script for quickly opening and attaching to tmux sessions | |
# | |
# It takes two optional arguments: a session name and directory. | |
# If no session name is provided, "main" is used. If no | |
# directory is provided, the current directory is used. Then | |
# it simply switches to that session. If that session doesn't | |
# exist, it creates it first and sets the default session. You'd | |
# think this would be trivial, but tmux requires many different | |
# options to create/attach a session based on the context. |
We can't make this file beautiful and searchable because it's too large.
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
trail_id,name,area_name,city_name,state_name,country_name,_geoloc,popularity,length,elevation_gain,difficulty_rating,route_type,visitor_usage,avg_rating,num_reviews,features,activities,units | |
10020048,Harding Ice Field Trail,Kenai Fjords National Park,Seward,Alaska,United States,"{'lat': 60.18852, 'lng': -149.63156}",24.8931,15610.598,1161.8976,5,out and back,3,5,423,"['dogs-no', 'forest', 'river', 'views', 'waterfall', 'wild-flowers', 'wildlife']","['birding', 'camping', 'hiking', 'nature-trips', 'trail-running']",i | |
10236086,Mount Healy Overlook Trail,Denali National Park,Denali National Park,Alaska,United States,"{'lat': 63.73049, 'lng': -148.91968}",18.0311,6920.162,507.7968,3,out and back,1,4.5,260,"['dogs-no', 'forest', 'views', 'wild-flowers', 'wildlife']","['birding', 'camping', 'hiking', 'nature-trips', 'walking']",i | |
10267857,Exit Glacier Trail,Kenai Fjords National Park,Seward,Alaska,United States,"{'lat': 60.18879, 'lng': -149.631}",17.7821,2896.812,81.9912,1,out and back,3,4.5,224,"['dogs-no', 'part |
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
1880 Bank | |
1st Advantage Bank | |
1st Bank | |
1st Bank in Hominy | |
1st Bank of Sea Isle City | |
1st Bank & Trust | |
1st Bank Yuma | |
1st Cameron State Bank | |
1st Century Bank | |
1st Colonial Community Bank |
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
### Prsteni ### | |
# https://open.kattis.com/problems/prsteni | |
# | |
# Input | |
# The first line of input contains an integer N(3≤N≤100), the number of rings. | |
# The next line contains N integers between 1 and 1000, the radii of Stanko’s | |
# rings, in the order they are laid out on the floor. | |
# | |
# Output | |
# The output must contain N−1 lines. For every ring other than the first, in the |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer