Skip to content

Instantly share code, notes, and snippets.

View dessibelle's full-sized avatar
🦊
Yes

Simon Fransson dessibelle

🦊
Yes
View GitHub Profile
@dessibelle
dessibelle / aws-console.sh
Last active March 30, 2023 09:44
Open an AWS console using separate Chrome profiles
#!/bin/bash
SCRIPT_NAME=$(basename $0)
function print_usage() {
echo "Usage:"
echo -e "\t${SCRIPT_NAME} [-p | --prompt <aws-vault prompt>] <aws_profile>"
echo -e "\nHint: set AWS_VAULT_PROMPT to e.g. 'ykman' to have aws-console default to ykman."
}

Keybase proof

I hereby claim:

  • I am dessibelle on github.
  • I am simonfransson (https://keybase.io/simonfransson) on keybase.
  • I have a public key ASBqmr6XF0GaMSNj6gpW2bQK6-ccdOGJOtQnh1QhGrXsWwo

To claim this, I am signing this object:

@dessibelle
dessibelle / git-grep-subl.sh
Last active March 21, 2018 09:13
Open git grep matches in Sublime
#!/usr/bin/env bash
files=`git grep --name-only ${1:+"$@"} | awk '{printf "%s ",$0} END {print ""}'`
if [[ ! -z "${files// }" ]] ; then
subl . && subl $files
else
echo "No matches."
fi
Is it Friday yet? Is the weekend here?
Is it time for me to kick things off with an ice cold beer?
Been working so dang hard that I forget:
Is it Friday yet?
8 o'clock on Monday morning
All I think about is when the day will end
Gotta make a living somehow
That's the way it is for me and all my friends
@dessibelle
dessibelle / chrome-osx-disable-ssl3-patch.sh
Created October 16, 2014 11:18
Chrome OS X POODLE patch
#!/usr/bin/env bash
BUNDLE_PATH="/Applications/Google Chrome.app"
APP_PATH="$BUNDLE_PATH/Contents"
PLIST_PATH="$APP_PATH/Contents/Info.plist"
EXECUTABLE_PATH="$APP_PATH/MacOS/Google Chrome"
EXECUTABLE_ARGS="--args --ssl-version-min=tls1"
LAUNCHER_SCRIPT_FILENAME="launch-chrome-tls.sh"
LAUNCHER_SCRIPT_PATH="$APP_PATH/MacOS/$LAUNCHER_SCRIPT_FILENAME"
@dessibelle
dessibelle / wifi-mount.sh
Last active December 29, 2015 13:29
Connects AFP shares (or any URL/path compatible with open really) depending on currently connected wifi network. Ideally executed using `cron` or `launchd`
#!/usr/bin/env bash
PROGRAM_NAME=`basename $0`
DEBUG=false
TARGET_ROUTER_MAC=()
SHARE=()
function debug {
[ $DEBUG == true ] && echo "$1"
@dessibelle
dessibelle / wp-mini-json-api.php
Last active December 23, 2015 19:19
Miniature JSON API for WordPress, returning posts of a specified post type in JSON format
<?php
class WPMiniJSONAPI {
const API_ACTION_QUERY_VAR = "my-api";
const API_PERMALINK_PART = "api";
const API_EVENTS_PERMLINIK_PART = "events";
const API_OUTPUT_FORMAT = "json";
const API_EXPORT_EVENTS = "export-events";
@dessibelle
dessibelle / ssh-transfer-key.sh
Last active December 23, 2015 17:29
Transfers your public SSH key (id_rsa.pub) to the authorized_keys file of a remote computer, allowing for password-less login.
#!/usr/bin/env bash
PROGRAM_NAME=`basename $0`
ARGS=`getopt u:H:h "$@"`
KEY_PATH=~/.ssh/id_rsa.pub
if [ $? != 0 ] ; then
echo "Error parsing arguments. Try $PROGRAM_NAME -h" > /dev/stderr
exit 2
@dessibelle
dessibelle / jetpack-override.css
Created September 18, 2013 10:56
Example WordPress plugin to override CSS
/* CSS overrides goes here */
#some-elem .some-class {
display: none;
}
@dessibelle
dessibelle / gist:6595023
Created September 17, 2013 14:24
Fix for missing activation hook in Taxonomy Order 1.1
--- orig.taxonomy-order.php 2013-09-17 16:18:19.000000000 +0200
+++ taxonomy-order.php 2013-09-17 16:18:50.000000000 +0200
@@ -86,7 +86,7 @@
self::$plugin_url = WP_PLUGIN_URL . '/' . self::$plugin_folder;
self::$plugin_file = self::$plugin_dir . '/taxonomy-order.php';
- register_activation_hook( self::$plugin_file, array( $this, 'activation_hook' ) );
+ // register_activation_hook( self::$plugin_file, array( $this, 'activation_hook' ) );
add_action( 'init', array($this, 'interface_wpdbfix') );