Skip to content

Instantly share code, notes, and snippets.

@jasonalderman
jasonalderman / acpk
Last active December 14, 2015 18:09
Quick-and-dirty bookmarklet for enabling spacebar and left/right arrow keys on Amazon Cloud Player. (Being quick-and-dirty, it only works after you've started playing an album or playlist.)
javascript:amznJQ.jQuery('body').bind('keyup',function(e){var p=amznMusic.widgets.player,k=amznJQ.jQuery.ui.keyCode;switch(e.which){case k.SPACE: p.playHash('togglePlay'); break; case k.LEFT: p.playHash('previous'); break; case k.RIGHT: p.playHash('next'); break;}});
@jasonalderman
jasonalderman / margatsni
Created April 1, 2015 21:50
Bookmarklet to do a reverse image search (Google Images) by clicking on any Instagram image in your home feed. (Idea by @rstevens.)
javascript:$(document).on('click','div.mediaPhoto',function(){var%20href=$(this).find('div.iImage').css('backgroundImage');href='https://images.google.com/searchbyimage?image_url='+encodeURIComponent(href.substring(4,href.length-1));window.open(href,'_blank');});
@jasonalderman
jasonalderman / primename
Created June 20, 2015 02:39
Quick function to determine if your name adds up to a prime number.
// ****
// Because I spent all week writing javascript, then I saw this:
// https://instagram.com/p/4DJNNbR5_P/
// and needed to automate it, like so:
// > getNumber("Wolfgang Mozart")
// returns: "Your name is not a prime number: Wolfgang Mozart (178)."
// ****
var getNumber = function getNumber(nameString) {
var arr = nameString.toLowerCase().split('');
var key = " abcdefghijklmnopqrstuvwxyz".split('');
@jasonalderman
jasonalderman / _chromenik
Last active February 9, 2016 10:20
Chrome extension to look up words on Wordnik.
An extension for Google Chrome that lets you look up words on Wordnik.
It's outdated—the manifest version is 1 when it should be 2—but it may work for you if you
• download the files
• go to chrome://extensions
• check "Developer Mode"
• "Load unpacked extension..."
The .zip file contains the following files:
- manifest.json
- background.html
@jasonalderman
jasonalderman / nfp
Created March 26, 2016 17:12
Nag-Free Pinterest: Quick-and-dirty bookmarklet to hide the nags and let you look at a Pinterest page while not logged in.
javascript:document.querySelector('div.Nags').remove();
#!/bin/sh
# Error out if anything fails.
set -e
# Make sure script is run as root.
if [ "$(id -u)" != "0" ]; then
echo "Must be run as root with sudo! Try: sudo ./install.sh"
exit 1
fi
@jasonalderman
jasonalderman / useful-git-commands.md
Created June 2, 2017 07:21
Git commands I'm learning are rather helpful.

Preview a merge without merging.

git merge --no-commit --no-ff <otherbranch>

Diff the filenames only, with status

git diff --name-status

@jasonalderman
jasonalderman / landingpage.html
Last active October 3, 2024 17:43
Simple, single-page, "coming soon" landing page template.
<!DOCTYPE html>
<html>
<head>
<!-- This is a template for a landing page!
✓ Fill in the things between the {{double braces}}, removing the {{ and }} in the process.
✓ Make a logo image for the <img> tag, and take note of its width and height.
✓ Make a sharing image for the OpenGraph/Facebook/Twitter <meta> tags (square, 1200x1200px).
✓ Tweak CSS as necessary.
✓ Rename this file to index.html and upload it and the two images to the web root directory on your server.
✓ Remove this comment when done. -->

Useful Mac commands

When microphone isn't working in Chrome in Hangouts

  1. sudo killall -9 coreaudiod
  2. Open new Chrome tab.

When you want to start a PHP Dev Server but access it from a phone or other computer

Instead of php -S localhost:8000 use php -S 0.0.0.0:8000 and you'll be able to see the server from http://<your IP address>:8000.

When you want to generate a localhost HTTPS certificate

@jasonalderman
jasonalderman / timecode-to-seconds.html
Last active September 26, 2017 18:53
Type a minute/second timecode (e.g., 2:47) in the top field, and get out a number of seconds (e.g., 167.0) below, and vice-versa. https://rawgit.com/jasonalderman/fe1e7b1d43442d82969f81fd2ffeff76/raw/ef635ba1dbe4362064be2c0853d79cae392c236c/timecode-to-seconds.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>timecode calculator</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
input {
font-size: 54px;