Skip to content

Instantly share code, notes, and snippets.

View akash1810's full-sized avatar
:bowtie:
erm

Akash Askoolum akash1810

:bowtie:
erm
View GitHub Profile
@akash1810
akash1810 / compass-rvm-init
Created March 17, 2015 23:43
simple alias to initialise a rvm with compass
#!/bin/sh
compass-rvm-init () {
rvm --ruby-version use 2.1.1@$1 --create
bundle init
echo "gem 'compass'" | tee -a Gemfile
bundle update
}
alias compass-rvm-init=compass-rvm-init
@akash1810
akash1810 / gist:38643b18ccd1cfc63c3f
Created June 3, 2015 14:54
AWS EC2 Public DNS from Private IP
#!/bin/sh
aws ec2 describe-instances --filters "Name=private-ip-address,Values=$1" | jq -c '.Reservations[0].Instances[].PublicDnsName'
@akash1810
akash1810 / slack-hook.gs
Last active October 13, 2021 13:42
Google Apps Script to post a message to Slack when someone responds to a Google Form.
/**
* ABOUT
* Google Apps Script to post a message to Slack when someone responds to a Google Form.
*
* Uses Slack incoming webhooks - https://api.slack.com/incoming-webhooks
* and FormsResponse - https://developers.google.com/apps-script/reference/forms/form-response
*
*
* AUTHOR
* Akash A <github.com/akash1810>
@akash1810
akash1810 / exifcats.sh
Created October 28, 2015 15:25
Displays the IPTC category information for an image.
#!/bin/bash
if [ $# -ne 1 ]
then
echo "usage: exifcats.sh <FILE>"
echo
echo "Displays the IPTC category information for an image."
echo
exit 1
fi
@akash1810
akash1810 / lifx-power
Created November 7, 2015 00:30
toggle the power of Lifx bulbs.
#!/bin/bash
: '
Toggle the power of Lifx bulbs.
Save to a directory on your PATH for simplicity - remember to give it execute permissions!
Requires a Lifx token (https://community.lifx.com/t/creating-a-lifx-http-api-token/25) to be stored in $HOME/.config/lifx/token
'
TOKEN=`cat $HOME/.config/lifx/token`
@akash1810
akash1810 / gist:13b432a6c0da0e9140fb
Last active March 21, 2016 11:51
YouTube utils
# Get YouTube ChannelId (from a Video page)
var channelId = $('meta[itemprop=channelId]').content;
@akash1810
akash1810 / hide-comments.js
Created June 18, 2016 21:18
hide youtube comments on channels you're not subscribed to (for @somoso)
if (! Boolean(document.querySelector('.yt-uix-subscription-button').getAttribute('data-is-subscribed'))) {
document.querySelector('.comment-section-renderer-items').style.display = 'none'
}
@akash1810
akash1810 / curl-time
Created June 28, 2016 22:27
timing a curl request
#!/bin/bash
curl --write-out %{time_total}\\n --output /dev/null --silent $1
@akash1810
akash1810 / iframe.html
Last active January 27, 2017 09:48
Chrome wat?!
<!DOCTYPE html>
<html>
<head></head>
<body>
<button type="button" onclick="window.parent.postMessage({name: 'foo'}, '*');">
Press Me
</button>
</body>
</html>
@akash1810
akash1810 / compare.sh
Last active November 15, 2019 17:39
Compare images between two Grid environments
#!/usr/bin/env bash
set -e
# Compare images between two Grid environments
# Assumes:
# - grid-cli installed `brew install guardian/devtools/grid-cli`
# - `test` and `prod` profiles configured `grid configuration:add`
# How it works:
# - Download image from PROD