Skip to content

Instantly share code, notes, and snippets.

View alana314's full-sized avatar

alana314

  • Ayzenberg
  • Los Angeles
View GitHub Profile
@alana314
alana314 / gist:3cf266365271b7ef4435a63d18e857ed
Created December 15, 2016 22:00
wt - change iterm window title
#!/bin/zsh
#usage: wt [title name]
#deselect all the options for window and tab titles in the iterm->preferences->appearance section. And in the .zshrc uncomment/add export DISABLE_AUTO_TITLE="true"
#via http://superuser.com/questions/292652/change-iterm2-window-and-tab-titles-in-zsh
echo -ne "\e]1;$1\a"
@alana314
alana314 / findexternallinks.js
Created September 16, 2016 22:56
Use node.js and jquery (cheerio) to recursively search files for external links
@alana314
alana314 / gist:f81e083fcfa532d6842014b0d70501c4
Created August 25, 2016 23:45
jQuery tweet button function using the window URL and content from twitter's meta tag
$('a.sharebutton.twitter').click(function(e){
window.open("https://twitter.com/intent/tweet?text=" + encodeURIComponent($('meta[name="twitter:description"]').attr('content').substring(0, 116)) + "&url=" + encodeURIComponent(window.location.href),"tweet", "width=500,height=300");
});
//Now with less jquery
//1) go to your my-list page, and scroll to the bottom to make sure it's all loaded:
//http://www.netflix.com/browse/my-list
//2) Next, paste this in your developer tools console and hit enter:
[...document.querySelectorAll('.slider [aria-label]')].map(ele => ele.getAttribute('aria-label'))
//or use this to copy the list to your clipboard:
copy([...document.querySelectorAll('.slider [aria-label]')].map(ele => ele.getAttribute('aria-label')))
@alana314
alana314 / launchd_wrapper.sh
Last active August 29, 2015 13:57 — forked from mystix/launchd_wrapper.sh
Identical to mystix's Tomcat launchd scripts except it uses /Library/Tomcat as catalina home.
#!/bin/bash
# NOTE: this is an OSX launchd wrapper shell script for Tomcat (to be placed in $CATALINA_HOME/bin)
CATALINA_HOME=/Library/Tomcat
function shutdown() {
date
echo "Shutting down Tomcat"
$CATALINA_HOME/bin/catalina.sh stop