Skip to content

Instantly share code, notes, and snippets.

View Jayphen's full-sized avatar
🏠
Working from home

Jayphen Jayphen

🏠
Working from home
View GitHub Profile
@Jayphen
Jayphen / settings.json
Last active March 12, 2019 12:40
ESlint/autosave VSCode settings
{
"prettier.eslintIntegration": true,
"editor.formatOnSave": true,
"eslint.enable": true,
"eslint.validate": [
"javascript",
"javascriptreact",
{ "language": "typescript", "autoFix": true },
{ "language": "typescriptreact", "autoFix": true }
],
@Jayphen
Jayphen / Breakpoints.js
Last active February 13, 2018 08:53
A wrapper around react-responsive to simplify breakpoint use
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import MediaQuery from 'react-responsive';
import {
labels,
getBreakpointValue,
getMaxBreakpointValue,
getNextBreakpoint
} from '../../util/breakpoints';
@Jayphen
Jayphen / always allow
Created May 25, 2015 23:53
Spam always allow when Chrome loses access to keychain
tell application "System Events"
repeat while exists (processes where name is "SecurityAgent")
repeat until exists window 1 of process "SecurityAgent"
end repeat
tell process "SecurityAgent"
click button "Always Allow" of window 1
end tell
end repeat
end tell
@Jayphen
Jayphen / gist:0a60c16c7e67118446aa
Created February 6, 2015 01:26
Pbcopy from remote SSH session back to OSX

Enable reverse tunelling on port 2224 locally…

echo "RemoteForward 2224 localhost:2224" >> ~/.ssh/config

SSH in to your server (I've only tried this on an Amazon AMI) and cat something

cat large-file.txt | nc localhost 2224
[am-Nav]
position: absolute
left: 0
top: -rhythm(2, 12px)
height: 100%
z-index: 20 // Footer is 30 zindex
color: #6E8A99
adjust-font-size-to(12px, 1, 16px)
+ #outer-wrap
@Jayphen
Jayphen / gist:f70d39b39e6ac2c9caee
Last active August 29, 2015 14:08
AMCSS Stylus helper
am($args)
if length($args) == 1
[am-{$args}]
{block}
else
$val = ()
for i in 1...length($args)
push($val, $args[i])
[am-{$args[0]}~=\"{join(' ', $val)}\"]
{block}
@Jayphen
Jayphen / cVim
Last active August 29, 2015 14:08
cVim
set noautofocus
set cncpcompletion
let locale = "aus" "requires my fork
let qmark a = ["http://forums.overclockers.com.au/forumdisplay.php?f=77", "http://ozbargain.com.au/"]
let qmark s = "http://sfcu.com.au/smf202/index.php?action=unread"
let qmark z = "http://ozbargain.com.au"
let blacklists = ["https://mail.google.com/*","https://inbox.google.com/*","*://*trello.com/b/*","*://*feedly.com/*"]
unmap r
let mapleader = " "
gulp = require 'gulp'
clean = require 'gulp-clean'
runWintersmith = require 'run-wintersmith'
cssshrink = require 'gulp-cssshrink'
uglify = require 'gulp-uglify'
uncss = require 'gulp-uncss'
image = require 'gulp-image'
deploy = require 'gulp-gh-pages'
concat = require 'gulp-concat'
@Jayphen
Jayphen / New reminder from Launchbar
Created July 27, 2012 12:18
A script for quickly adding reminders to the Reminders app in Mountain Lion from Launchbar. Save this as a .scpt and drop it in ~/Library/Application\ Support/LaunchBar/Actions
on handle_string(str)
set arrayWithDate to my theSplit(str, "@")
if arrayWithDate's length > 1 then
set theDate to my parseDate(getArrayValue(arrayWithDate, 2))
end if
set arrayWithBody to my theSplit(getArrayValue(arrayWithDate, 1), "#")
if arrayWithBody's length > 1 then
set reminderBody to my getArrayValue(arrayWithBody, 2)
else
@Jayphen
Jayphen / Regex: AU mobiles
Created July 10, 2012 05:45
Regex to match Aus mobile numbers. Remove spaces and brackets before running this
(^\+61\d{9}$)|(^04\d{8}$)