Skip to content

Instantly share code, notes, and snippets.

(function() {
if (!window.jQuery) {
var s = document.createElement('script');
s.setAttribute('src', 'https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js');
document.body.appendChild(s);
}
})();
@taeram
taeram / video-to-hq-gif.sh
Created December 8, 2018 17:25
Convert Video to Gif
#!/bin/sh
palette="/tmp/palette.png"
filters="fps=15,scale=320:-1:flags=lanczos"
ffmpeg -v warning -i "$1" -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i "$1" -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y "$2"
@taeram
taeram / mysql-snippets.sql
Last active September 30, 2016 16:51
MySQL Snippets
-- Table sizes, ordered by Database
SELECT table_schema AS "Database",
table_name AS "Table",
ROUND(((data_length) / 1024 / 1024), 2) AS "Data (MB)",
ROUND(((index_length) / 1024 / 1024), 2) AS "Indexes (MB)",
ROUND(((data_length + index_length) / 1024 / 1024), 2) "Total (MB)"
FROM information_schema.TABLES
WHERE table_schema NOT IN ("information_schema", "mysql")
ORDER BY table_schema ASC, table_name ASC;
@taeram
taeram / keybase.md
Created September 24, 2014 22:03
keybase.md

Keybase proof

I hereby claim:

  • I am taeram on github.
  • I am taeram (https://keybase.io/taeram) on keybase.
  • I have a public key whose fingerprint is E7FA CA7A A75F AE11 7FFC 7881 B2B8 727C 6360 9D30

To claim this, I am signing this object:

@taeram
taeram / snippets.sh
Last active June 3, 2019 17:20
Handy Bash Code Snippets and functions
############################
#### Google Shell Style Guide
############################
http://google-styleguide.googlecode.com/svn/trunk/shell.xml
## Increment a variable
siteId=0
siteId=$(( siteId+1 ))
echo $siteId # 1
siteId=$(( siteId+1 ))
@taeram
taeram / web-dev-brain-dump.md
Last active July 6, 2016 20:13
Web Development brain dump

These suggestions are geared towards the Linux/MySQL/Apache/PHP portion of the code-o-sphere.

Source Control

There are many flavours of source control, like CVS, Perforce, SVN, git and Mercurial. I've used CVS, SVN and git, and my overall favourite is git.

Free hosting of public git repositories, and a great social coding environment can be found on GitHub. I'd highly recommend contributing to some open source projects on GitHub, or creating your own projects, as it's an excellent place to point potential employers to, as they can actually see code you've written.

If you want to host private git repositories, Bitbucket allows you to host an infinite number of private repos for teams of up to 5 users.

@taeram
taeram / web-dev-chrome-extensions.md
Last active March 24, 2024 16:30
A list of useful Chrome Extensions for web development

Chrome Web Development Extensions

  • ColorZilla - Advanced Eyedropper, Color Picker
  • Postman - Easy testing of custom HTTP / API requests.
  • Especially useful when combined with requestb.in when testing the format of HTTP GET/POST/PUT/DELETE requests
  • Edit This Cookie - Edit This Cookie is a cookie manager. You can add, delete, edit, search, protect and block cookies!
  • HN Special - A new visual style for Hacker News as well as new features
  • MeasureIt! - Draw out a ruler that will help you get the pixel width and height of any elements on a webpage
  • PageSpeed Insights - Anal
@taeram
taeram / install-ffmpeg.sh
Last active March 23, 2019 17:15
Install the latest FFmpeg on Ubuntu 14.04
#!/bin/bash
# fail fast
set -e
TARBALL_URL="https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz"
echo "*** Downloading "$( basename "$TARBALL_URL" )
TMP_DIR=$( mktemp -d )
curl --silent $TARBALL_URL | sudo tar Jx -C $TMP_DIR --strip-components=1