Skip to content

Instantly share code, notes, and snippets.

View lee2sman's full-sized avatar

Lee T lee2sman

  • W/O/R/L/D/W/I/D/E
View GitHub Profile
@lee2sman
lee2sman / VideoConverterScript
Created December 10, 2014 04:04
Convert mp4 to mov files in a folder with ffmpeg
#!/bin/sh
####################################################################
# a script that will use ffmpeg to convert .mp4 to .mov #
# #
# run this script in a folder filled with .mp4 files. #
# (this script works, but it is not pretty. :-) #
####################################################################
EXT=".mov"
EXT1=".mp4"
EXT2=".sh"
@lee2sman
lee2sman / pizza.py
Last active September 18, 2016 23:20
pizza calculator
#!/usr/bin/env python
#pizza.py
#is a pizza pie calculator
#It determines how many pizzas you need to purchase dependent on number of people that will consume pizza.
#Assumes standard hungry person eats 3 slices. Rounds up so there is leftover pizza.
#Lee 2sman April 2015
import math
@lee2sman
lee2sman / rename_numerically.sh
Created July 17, 2015 03:34
rename all files in a folder sequentially
#!/bin/bash
# batch rename all items in a folder regardless of title into sequential number order
# warning: will throw an error if you have any
i=1
for f in *.jpg # remove .jpg if you want to force rename all files but be careful. Also: will throw error with directories
do mv "$f" "$( printf "%02d.jpg" $i )" # the 02d means generate file numbers 00-99. use 3d for 000-999.
((i++))
done
@lee2sman
lee2sman / readme.md
Last active August 29, 2015 14:25 — forked from anonymous/readme.txt

Play this game here. Puzzlescript code to generate the game below.

@lee2sman
lee2sman / appify
Last active August 29, 2015 14:25 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@lee2sman
lee2sman / Simplified Markdown Cheatsheet
Last active April 27, 2016 05:45
My simplified markdown syntax cheatsheet
Special symbols for formatting in Markdown
Heading
=======
Sub-heading
-----------
# A large heading
### Another heading, but smaller still
@lee2sman
lee2sman / index.md
Last active May 23, 2016 17:25 — forked from aparrish/index.md
UC Santa Cruz Workshop for Writ Large

Writing Poetry with Procedure: A Workshop

Led by Allison Parrish

Description

Practitioners in the field of procedural writing have been using rules, procedures and computer programs to create innovative literary work since the invention of the digital computer. Far from the bland imitation evoked by the phrase "computer-generated poetry," these techniques facilitate the creation of work with aesthetic and emotional affordances sometimes difficult to achieve through conventional compositional techniques: serendipitous beauty, precisely imitative satire, vertiginous wonder at the infinite. In this workshop, participants will learn about the history of computer-generated writing and sample a range of off-the-shelf, freely-available tools on the web to create their own—without writing any actual lines of code. No previous programming experience is required.

Outline

@lee2sman
lee2sman / 750words.sh
Created August 29, 2016 17:16
This 750words shell script is based on the idea of writing 750 words a day as a form of mindfulness and meditation.
#!/bin/bash
# This 750words program is based on the idea of writing 750 words a day as a form of mindfulness and meditation.
# This program prompts the user for input and saves output to your journal. It prompts you to type additional words until you have completed at least 750 words minimum.
journal_loc=/Users/2sman/Documents/journal.txt #Replace with location of your journal
words_needed=750
current_typed=0
entry=""
@lee2sman
lee2sman / duck
Created September 17, 2016 06:49
Search duckduckgo from commandline on PocketCHIP using SURF
#!/bin/bash
#
# Duckduckgo commandline search on PocketCHIP using surf
# cc0 by Lee2sman
if [ $# -eq 0 ]
then
#Exits if you don't put anything to search after duck
echo "No search arguments entered."
exit 1
@lee2sman
lee2sman / wikisearch
Last active September 18, 2016 06:34
Commandline Wikipedia Search - put this in your $PATH like usr/local/bin - it's a brute force hack but it works
#!/bin/bash
#
# wikisearch: Wikipedia search in the commandline
# cc0 by Lee2sman 2016
# DEPENDENCIES: w3m
# USAGE: wikisearch [search term]
hash w3m &> /dev/null
if [ $? -eq 1 ] #Checks to see if w3m is installed