Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Powell stringsn88keys

View GitHub Profile
@janaz
janaz / get-aws-console-url.js
Last active Apr 15, 2021
Generate AWS console URL from the credentials stored in environment variables
View get-aws-console-url.js
/**
* This little program prints out the url to the AWS console
* generated from the local AWS credentials stored in environment variables:
* AWS_ACCESS_KEY_ID
* AWS_SECRET_ACCESS_KEY
* AWS_SESSION_TOKEN
*
* Steps:
* 1. Create a JSON object
* session = JSON.stringify({
@retorillo
retorillo / latex2png_win.md
Last active Mar 23, 2021
LaTeX to PNG on Windows
View latex2png_win.md

LaTeX to PNG on Windows

Prerequisite

  • Windows System (Tested on Windows 10)
  • pdflatex TexLive (/w standalone package)
  • magick Image Magick
    • choco install imagemagick
  • gswin32c Ghost Script (x86)
@galexrt
galexrt / hb_all_books_dl.js
Last active Jan 17, 2020 — forked from kfatehi/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
View hb_all_books_dl.js
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
this fork downloads all formats and does so without using jquery (since that didnt work for me)
note that if you are in chrome, chrome will not download the pdfs for you by default, to fix this
type “about:plugins” in the address bar and disable chrome's pdf viewer
*/
var pattern = /(ZIP|MOBI|EPUB.*|PDF|PDF( ?\(H.\))?|CBZ|PRC|Download|Supplement)$/i;
@searls
searls / hue-ci
Last active Jun 27, 2016
Tying up Philips Hue lights to the exit-code status of my shell
View hue-ci
#!/usr/bin/env node
/**
* Activates all Philips Hue scenes for a given name, optionally
* restricted to a particular group (the new app seems to make scenes universal
* across groups so it may be necessary to look up the group ID associated with
* the room you want to be affected.
*
* Example usage:
*
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active Nov 30, 2021
Useful PostgreSQL Queries and Commands
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')