Skip to content

Instantly share code, notes, and snippets.

🙌
🙌

Loisaida Sam loisaidasam

🙌
🙌
Block or report user

Report or block loisaidasam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View solve.sh
#!/bin/bash
# Solver for https://permanent-redirect.xyz
# Saves HTML pages to `pages/` dir
page="$1";
if [ -z "$page" ]
then
echo "Pass a starting page!";
exit 1;
@loisaidasam
loisaidasam / picblast.sh
Last active Aug 2, 2019 — forked from bwhitman/picblast.sh
Make an audio collage out of your live photos
View picblast.sh
#!/bin/bash
mkdir /tmp/picblast
cd ~/Pictures/Photos\ Library.photoslibrary
for i in $(find . | grep jpegvideocompl)
do
ffmpeg -i $i /tmp/picblast/${i:(-8)}.wav
done
@loisaidasam
loisaidasam / bellababy.sh
Created Feb 3, 2016
Download your bellababy photos
View bellababy.sh
#!/bin/bash
# To download your BellaBaby photos
# (people who come to the hospital and take photos of you and your newborn)
# Note: They are watermarked - you have to pay (big bucks) for the originals!
# This seemed to be the convention for my photos:
TAG="<photographer_name><date><your_last_name>"
# Files 1-9 have slightly different structure...
@loisaidasam
loisaidasam / wilson.py
Last active Jul 23, 2019
Python implementation - Lower bound of Wilson score confidence interval for a Bernoulli parameter
View wilson.py
"""
Python implementation - Lower bound of Wilson score confidence interval for a Bernoulli parameter
- http://www.evanmiller.org/how-not-to-sort-by-average-rating.html
- https://news.ycombinator.com/item?id=15131611
- https://stackoverflow.com/questions/10029588/python-implementation-of-the-wilson-score-interval/45965534
- https://stackoverflow.com/questions/10029588/python-implementation-of-the-wilson-score-interval/45965534#45965534
"""
import math
@loisaidasam
loisaidasam / gist:2774350
Created May 23, 2012
One liner for counting unique IP addresses from nginx logs
View gist:2774350
# One liner for counting unique IP addresses from nginx logs
# Feel free to comment with better ideas - I'm sure it's not the best way of doing this (I'm no awk ninja!)
#
# Sample output:
#
# $ cat example.com.access.log | awk -F " " '{a[$1]++ } END { for (b in a) { print b, "\t", a[b] } }'
# 66.65.145.220 49
# 92.63.28.68 126
cat example.com.access.log | awk -F " " '{a[$1]++ } END { for (b in a) { print b, "\t", a[b] } }'
@loisaidasam
loisaidasam / README.md
Last active Jun 5, 2019
Sort git tags by semver
View README.md

If you're like me and you use semver for versioning your tags, you probably hate when you do this:

$ git tag -l
0.1.0
0.10.0
0.2.0
0.3.0
0.3.1
0.4.0
0.5.0
@loisaidasam
loisaidasam / README.md
Last active Apr 12, 2019
The Masters API!
View README.md
@loisaidasam
loisaidasam / git-find-large-files
Created Mar 15, 2019
Shows you the largest objects in your repo's pack file.
View git-find-large-files
#!/bin/bash
# git-find-large-files
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @see https://stackoverflow.com/questions/10622179/how-to-find-identify-large-commits-in-git-history/10622293#10622293
# @author Antony Stubbs
@loisaidasam
loisaidasam / would-you-rather
Last active Mar 5, 2019
Would You Rather (via rrrather.com API, using curl/jq)
View would-you-rather
#!/bin/bash
jq_str='(.title + ": " + .choicea + " OR " + .choiceb + " - " + .link + " (" + (.votes|tostring) + " votes)")'
curl -Ss "https://www.rrrather.com/botapi" | jq -r "$jq_str"
You can’t perform that action at this time.