Skip to content

Instantly share code, notes, and snippets.

@JulesAU
JulesAU / wordle.md
Created February 2, 2022 06:54 — forked from huytd/wordle.md
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@JulesAU
JulesAU / receive-alerts.js
Last active March 18, 2020 04:53
Receiving JSON Wormly Alerts in NodeJS
// Receive alerts from the Wormly Webhook Alert channel.
// https://www.wormly.com/help/channels/http-rpc
require('http').createServer(function (req, res) {
var alert = '';
req.on('data', function (chunk) { alert += chunk.toString() });
req.on('end', function () {
if (req.headers['content-type'] === 'application/json') {
/* render HH:mm from a time delta */
function renderMinutesSeconds(ts, now) {
var seconds = Math.round(now - ts);
var minutes = Math.floor(seconds / 60);
seconds = (seconds % 60);
return String("0" + minutes).slice(-2) + ":" + String("0" + seconds).slice(-2);
}
@JulesAU
JulesAU / gist:6321976
Last active July 22, 2016 18:06
Installing mod_spdy on Centos / Redhat / Amazon Linux
# Manually:
yum install -y https://dl-ssl.google.com/dl/linux/direct/mod-spdy-beta_current_x86_64.rpm
# Or in a Chef recipe for extra DevOps karma:
execute "mod-spdy-beta" do
command "yum install -y https://dl-ssl.google.com/dl/linux/direct/mod-spdy-beta_current_x86_64.rpm"
not_if "test -f /etc/httpd/conf.d/spdy.conf"
end
@JulesAU
JulesAU / gist:6320420
Created August 23, 2013 15:09
Request header example
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:w=000000000000; aid=000000000000
Host:www.wormly.com
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36
@JulesAU
JulesAU / what-js-libs.js
Created June 10, 2013 11:58
What JS libraries / objects is that website using? Paste this into the JS console
for (var f in window)
{
try {
if (!window[f].toString().match(/native code/)) {
console.log(f);
}
} catch (e) {}
}
@JulesAU
JulesAU / wormly-api.sh
Created August 17, 2011 06:47
Wormly API - manipulate alert recipients
# Choose a host which is configured to use host-specific alert recipients.
# You will find the Host ID in small gray text next to its' name on the
# Host Overview page (wormly.com/answers/sid/63/topicid/13).
# Now, prepare some environment variables:
export HOSTID=12345
export WORMLY_API_KEY=<Insert your API key here>
# First, check to see if you can read the alert matrix
/*
We have two classes: resultRenderer and dbQuery
resultRenderer will ask dbQuery to perform a database query, and asyncronously receives the results
*/
function resultRenderer(query) { this._query = query }
resultRenderer.prototype = {
queryResultsAndRender: function () {
this._query.runQueryAsync(this.renderResults.bind(this));