Skip to content

Instantly share code, notes, and snippets.

View lukephills's full-sized avatar

Luke Phillips lukephills

View GitHub Profile
@lukephills
lukephills / duolingoStats.js
Created January 10, 2017 21:40
Function to get current duolingo tree progress
function getDuolingoTreeProgress() {
var s = $('.skill-icon').length,
g = $('.gold').length,
p = parseInt((g/s) * 100);
return 'Out of a total of '+s+' skills, you have '+g+' gold ('+p+'% completed).';
}
getDuolingoTreeProgress()
@lukephills
lukephills / change-MAC-address.md
Last active August 10, 2016 03:16
Resetting MAC for free wifi

###If you have a Mac:

Open Terminal and type in:

sudo ifconfig en1 lladdr 00:aa:bb:cc:dd:ee

Hit Enter and type your password. Reconnect to the hotel Wi-Fi and you’ll be seen as a new device, with a brand new free Wi-Fi period. Change the number separated by colons to anything between 00 and ff to create new ‘identities’ on the hotel Wi-Fi system, as often as you like. Voilà!

###On Windows (depending on if your network card allows it):

@lukephills
lukephills / gh-pages-deploy.md
Created May 3, 2016 04:41 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@lukephills
lukephills / gist:fb73b83bf8a4d6c91ae7
Last active August 29, 2015 14:24
Change all images on local site to point to the remote site
function updateImages(localUrl, remoteUrl) {
var imgs = document.getElementsByTagName('img')
for (i = 0; i<imgs.length; i++) {
imgs[i].src = imgs[i].src.replace(localUrl, remoteUrl)
}
}
updateImages('http://www.kollektivgallery.dev', 'http://www.kollektivgallery.com')
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@lukephills
lukephills / gist:61b73454dad73182130e
Created April 6, 2015 08:21
Hover states - Quickly fix hover/normal states if you don’t need to style every state differently.
/**
* Normal States
*/
@mixin normal {
&:link,
&:visited {
@content;
}
}
// From http://stackoverflow.com/questions/11381673/javascript-solution-to-detect-mobile-browser#answer-13819253
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
@lukephills
lukephills / touch swipe direction
Last active August 29, 2015 14:08
Touch, move & swipe directions
var Event = (function(){
/* Config vars */
var MIN_SWIPE = 30,
startPos = [],
endPos = [];
var _listenEvents = function(element, callback){
@lukephills
lukephills / _reset
Created October 27, 2014 11:14
_reset.scss
// http://meyerweb.com/eric/tools/css/reset/
// v2.0 | 20110126
// License: none (public domain)
@mixin reset {
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
/**
* Bootstrap responsive breakpoints mixins
*
*/
$screen-xs: 480px;
$screen-sm: 768px;
$screen-md: 992px;
$screen-lg: 1200px;
@mixin xxs {