Skip to content

Instantly share code, notes, and snippets.

View amanaplan's full-sized avatar

Christian Stück amanaplan

  • St. Petersburg, FL
View GitHub Profile
@amanaplan
amanaplan / gist:4704517
Last active March 28, 2023 05:18
Archived: Gateway script to tunnel to a service by creating and using a local SOCKS proxy via an SSH tunnel on your remote endpoint. Secure and faster than VPN.
#!/bin/bash
CMD_DEFAULT=start
RUNNING=$(sudo networksetup -getsocksfirewallproxy Wi-Fi | grep 1080)
CMD=${1:-$CMD_DEFAULT} # Set default
if [ "$CMD" = "start" -a "$RUNNING" != "Port: 1080" ]
then
sudo ssh -C -D 1080 myusername@remote.example.com -f -N > /dev/null 2>&1
@amanaplan
amanaplan / jQuery UI-ify Bookmarklet JS Source
Created November 15, 2013 13:11
Loads jQuery UI to match jQuery version, if loaded.
if (typeof jQuery != 'undefined' && typeof jQuery.ui == 'undefined'){
jqver = jQuery().jquery;
parent = document.documentElement.childNodes[0];
scriptui = document.createElement('script');
scriptui.type = 'text/javascript';
scriptui.src = 'https://ajax.googleapis.com/ajax/libs/jqueryui/' + jqver + '/jquery-ui.js';
parent.appendChild(scriptui);
alert('Loading your matches...');
}
else {
@amanaplan
amanaplan / advanced-typography.css
Created August 18, 2014 21:02
Advanced Typography CSS — See http://blog.webink.com/opentype-features-css/ for more information
/* Turn on typographical kerning,
* standard and contextual ligatures,
* and contextual alternatives */
body {
-moz-font-feature-settings: "calt", "liga", "clig", "kern";
-moz-font-feature-settings: "calt=1, liga=1, clig=1, kern=1";
-ms-font-feature-settings: "calt", "liga", "clig", "kern";
-o-font-feature-settings: "calt", "liga", "clig", "kern";
-webkit-font-feature-settings: "calt", "liga", "clig", "kern";
font-feature-settings: "calt", "liga", "clig", "kern";
@amanaplan
amanaplan / single-use-commerice-coupon-create.php
Created August 2, 2016 20:08
Create a single-use Commerce coupon programmatically
<?php
/**
* Create a single-use Commerce coupon programmatically
*/
// Get all available coupon types
// $types = commerce_coupon_get_types();
// Create a default coupon instance
@amanaplan
amanaplan / jira-cloud-add-tempo-log-work-btn.user.js
Last active August 16, 2016 17:18
Userscript: JIRA Cloud Add Tempo Log Work Button
// ==UserScript==
// @name JIRA Add Tempo 'Log Work' button
// @namespace http://csclients.xyz/
// @updateURL https://gist.github.com/amanaplan/05619ad0b160d73988e076b02d79074a/raw/9703e2a0ec7e94da91558ffcd33d0e39862b4578/jira-cloud-add-tempo-log-work-btn.user.js
// @version 0.2
// @description Adds Tempo 'Log Work' button to JIRA hosted on Atlassian Cloud.
// @author Christian Stück <christianstuck@gmail.com>
// @match https://*.atlassian.net/browse/*-*
// @grant none
// ==/UserScript==
@amanaplan
amanaplan / install_drupal_phpstorm_livetemplates.sh
Created October 1, 2016 08:32
Install Drupal PhpStorm live templates
#!/bin/bash
# Installs Drupal live templates for PhpStorm.
# After successfully executing, please restart PhpStorm.
#
# Requires Git and PHP CLI to be installed and available.
#
# Adapted from project instructions, available at
# https://www.drupal.org/project/phpstorm_templates
@amanaplan
amanaplan / uli.sh
Created October 10, 2016 15:32
Drush ULI Secure Link Bash Script
#!/usr/bin/env bash
if [ -z "$1" ]
then
# Print usage instructions.
echo "usage: uli alias"
else
uli=`drush $1 uli --browser=none`
echo "${uli/http/https}"
fi
@amanaplan
amanaplan / d7_language_hierarchy_inter_changelog.md
Created October 31, 2016 02:55
Drupal Language Hierarchy 7.x-1.x-dev commits since 7.x-1.4 release

Drupal Language Hierarchy 7.x-1.x-dev

Stable, community-vetted commits since 7.x-1.4 release

@amanaplan
amanaplan / responsive-modal.css
Created April 6, 2017 15:44 — forked from jameswilson/responsive-modal.css
Drupal Ctools Responsive Modal
/* Override inline dom styles from modal.js */
#modalContent {
position: fixed !important;
top: 12% !important;
bottom: 12% !important;
right: 4% !important;
left: 4% !important;
}
/* Limit max width to 1000px */
div.ctools-modal-content {