Skip to content

Instantly share code, notes, and snippets.

View telekineticyeti's full-sized avatar

Paul Castle telekineticyeti

  • Aberdeen, Scotland
View GitHub Profile
@telekineticyeti
telekineticyeti / mysql-docker.sh
Created September 23, 2019 13:25 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@telekineticyeti
telekineticyeti / Paypal Email Transaction Regex
Created May 7, 2019 12:59
Extract the Time/Date, Transaction ID, Amount, Currency and Merchant Name from a Pypal transaction email. Useful regex to use in automation services like Zapier.
(\d{1,2} \w+ \d{4} \d{1,2}\:\d{1,2}\:\d{1,2} \w{3})\s+Transaction ID:\s+([\d\w]*)[\S\s.]*(?:You sent a payment of )[\$\£]?(\d+\.\d+) (\w{3}) to (.*)
@telekineticyeti
telekineticyeti / GSAP multiple element timeline hover effect.js
Last active March 21, 2018 16:48
GSAP multiple element timeline hover in/out effect
// Creates the element timeline
function bucketAnimation(element) {
var tl = new TimelineMax(),
bucket = $(element);
tl
.to(bucket.find('p'), .5, { opacity: 0 })
.to(bucket.find('ul'), 0, { opacity: 1 })
.staggerFrom(bucket.find('li'), .4, { opacity: 0, y: 100, ease: Back.easeOut }, .15);
return tl;
@telekineticyeti
telekineticyeti / tweeten_custom.css
Last active August 25, 2021 05:25
Custom CSS settings for Tweeten chrome extension
.js-app .js-column .stream-item .tweet-timestamp a { font-size: 9px !important; }
.js-app .js-column .stream-item .account-link .account-inline .fullname { font-size: 11px !important }
.js-app .js-column .column-header .column-title .attribution { display: none; }
.js-app .js-column .column-header .column-title span { font-size: 10px !important; }
body .js-app .js-column article.stream-item .nbfc {font-size: 10px !important; line-height: 14px !important; }
.column-title-back .icon, .column-title-back .Icon { top: 18px !important; }
@telekineticyeti
telekineticyeti / monitor_rotation.ahk
Created January 13, 2018 20:32
AutoHotKey monitor rotation
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
MyPath = C:\Program Files (x86)\iRotate\iRotate.exe
#+!Up::
Run %MyPath% /2:rotate=0
Return
@telekineticyeti
telekineticyeti / nucleus.js
Created August 8, 2016 11:32
Gallery Nucleus Bookmarklet
// Open the source image of an art piece's detail page. Simply paste into the code console or a bookmarklet.
javascript:(function(){window.open(getComputedStyle(document.getElementsByClassName("zoomWindow")[0],'').getPropertyValue('background-image').replace('url(\"', '').replace('\"\)', ''), "_self");})()
@telekineticyeti
telekineticyeti / project.json
Last active August 29, 2015 14:16
Sublime Text - Hide Files and/or Folders. Add lines 5 & 6 on a per-folder basis.
{
"folders":
[
{
"file_exclude_patterns" :["config.rb", "Guardfile"],
"folder_exclude_patterns" :["_notes", ".sass-cache"],
"follow_symlinks": true,
"path": "/Volumes/projects/myproject/"
}
]
$(window).scroll(function() {
$('.navbar-fixed').addClass('scrolling');
clearTimeout($.data(this, 'scrollTimer'));
$.data(this, 'scrollTimer', setTimeout(function() {
$('.navbar-fixed').removeClass('scrolling');
}, 50));
});
@telekineticyeti
telekineticyeti / phpfilter.rb
Last active August 29, 2015 13:57
A simple HAML PHP Filter for middleman.
module Haml::Filters::Php
include Haml::Filters::Base
def render(text)
<<END
<?php
#{text.rstrip.gsub("\n", "\n ")}
?>
END
end
@telekineticyeti
telekineticyeti / lorempixel.rb
Created August 13, 2013 01:56
A simple ruby method that was created as a Middleman (http://middlemanapp.com/) helper. It generates an img tag, using stock images from lorempixel (formerly lorempixum).
# lorempixel
# Outputs a (random) image of specified dimensions
# from http://lorempixel.com/.
# Example: =lorempixel "300x150"
#
# Use :theme => 'category'
# to set a specific theme
def lorempixel(dimensions, opt = {})