Skip to content

Instantly share code, notes, and snippets.

View sillygwailo's full-sized avatar
💭
Looking for collaborators.

Richard Eriksson sillygwailo

💭
Looking for collaborators.
View GitHub Profile
#! /bin/bash
# Enter a time using 24H. 1:30pm is 13:30 .
ENTERTIME="%filltext:name=Time (in 24H)%"
# See https://gist.github.com/palaniraja/f8e21e8c66eac7e1b313 for a
# list of time zone names.
T1=$(TZ="America/New_York" date -jf "%H:%M %z" "$ENTERTIME $(date "+%z")" "+%-I:%M %p %Z" | tr -s '[:lower:]' '[:upper:]')
@sillygwailo
sillygwailo / goodreads-bookmarklet.js
Last active January 22, 2022 18:31 — forked from lightningdb/goodreads-bookmarklet.js
Add to Goodreads from Amazon.com book page bookmarklet
javascript: var asin_elements, asin;
asin_elements = document.getElementsByName('ASIN');
if (asin_elements.length == 0) {
asin_elements = document.getElementsByName('ASIN.0');
};
if (asin_elements.length == 0) {
alert('Sorry, this doesn\'t appear to be an Amazon book page.');
} else {
asin = asin_elements[0].value;
if (asin.match(/\D/) === null) {
@sillygwailo
sillygwailo / amazon_ca.js
Created July 23, 2020 18:23
Bookmarklet to switch from an Amazon.com URL to the Amazon.ca equivalent
url = new URL(window.location.href);
if (url.hostname = 'amazon.com') {
amazon_ca = url.href.replace('amazon.com', 'amazon.ca');
location.href = amazon_ca;
}
@sillygwailo
sillygwailo / break-out-of-sniply-frames.user.js
Created February 10, 2016 19:24
Break out of Snip.ly frames
// ==UserScript==
// @name Break out of Snip.ly frames
// @version 0.1
// @include http://snip.ly/*
// @author Richard Eriksson
// ==/UserScript==
var current_hash = window.location.hash;
var destination_url = current_hash.slice(1);
// Thank you, Stack Overflow. http://stackoverflow.com/a/18970172/300278
<?php
/**
* @file
* Contains \Drupal\configform_example\Form\ConfigFormExampleConfigForm.
*/
namespace Drupal\configform_example\Form;
use Drupal\Core\Form\ConfigFormBase;
@sillygwailo
sillygwailo / renew-le-ssl.yml
Last active March 14, 2016 20:46
Ansible playblook to renew Let's Encrypt SSL
---
- hosts: YOUR_HOST_HERE
tasks:
- name: Stop Apache
service: name=httpd state=stopped
become: yes
become_user: root
- name: Renew Let's Encrypt certificate
command: ./letsencrypt-auto --agree-dev-preview --renew-by-default -t -d YOUR_DOMAIN_HERE -d YOUR_WWW_SUBDOMAIN_AND_DOMAIN_HERE --server https://acme-v01.api.letsencrypt.org/directory auth
@sillygwailo
sillygwailo / demobilizer-vancouver-sun-cbc-links.patch
Created April 8, 2015 20:24
Add CBC and Vancouver Sun links to the Demobilizer Safari Extension

Custom Twitter Stylesheet

Craig Mod does a bigger overhaul with Twitter for Minimalists, but this will only do the following:

  • Hides promoted tweets and trends
  • Hides the useless “Expand” link that appears under every tweet
  • Tones down the blue conversation line to a barely-visible gray
  • Hides all numbers

You can add this CSS in Safari with this extension. The URL to target is twitter.com/*.

@sillygwailo
sillygwailo / Gruntfile.js
Created March 3, 2015 21:14
questions.justagwailo.com Grunt deployment and notification
module.exports = function(grunt) {
grunt.initConfig({
notify: {
surge: {
options: {
title: 'questions.justagwailo.com',
message: 'Deployment complete.',
}
},
},
@sillygwailo
sillygwailo / gist:20c18e877f1d0569e954
Last active August 29, 2015 14:15
Compiling a forked Node.js module written in CoffeeScript
  1. I have a fork of a Node.js module on GitHub that is a depenency of an app.
  2. That module is written in CoffeeScript. When 'npm install' downloads it, it doesn't compile the module. This is a problem when deploying the app to Heroku, because I can't compile it when deploying to Heroku.
  3. Furthermore, compiling the module has its own depenencies. The dependencies need to be installed before it can be installed.
  4. If I manually run 'npm install' in the forked module's directory inside node_modules, then 'grunt prepublish', everything will work.
  5. I need to automate step #4 when installing the app. How do I do that?

The app in question is https://github.com/sillygwailo/Slack-Twitter If you run npm install in that directory, the slack-client module will not get compiled.

A Solution?