Skip to content

Instantly share code, notes, and snippets.

Max Kohler awesomephant

Block or report user

Report or block awesomephant

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@awesomephant
awesomephant / bp.scss
Created May 26, 2019
Sass breakpoint mixin
View bp.scss
@mixin bp($point) {
@if $point==xl {
@media (min-width: 85rem) {
@content;
}
}
@else if $point==l {
@media (min-width: 70rem) {
@content;
}
View test.js
console.log('Hello World 123')
@awesomephant
awesomephant / mousemove.js
Last active Jan 24, 2019
Mousemove Optimized
View mousemove.js
var last_known_scroll_position = 0;
var ticking = false;
function doSomething(scroll_pos) {
// do something with the scroll position
}
window.addEventListener('mousemove', function(e) {
last_known_position = {
View parseSwitchboard.js
const fs = require('fs');
const path = require('path');
const parse = require('csv-parse/lib/sync');
const mkdirp = require('mkdirp');
const dataDir = './data/switchboard_conversations/';
const outputDir = './data/clean/';
let topics = fs.readdirSync(dataDir)
let data = [];
View gist:ac7c05bda60ab7bf8e3135f710cc2d4e
gm montage -tile 28x19 -background "black" -geometry 300x300+2+2 *.jpg grid.jpg
@awesomephant
awesomephant / wp-setup
Last active Apr 1, 2018
Install common WP plugins
View wp-setup
cd ap ; wp core update ; wp plugin update --all; wp theme update --all ; wp plugin delete hello ; wp plugin delete akismet ; wp plugin install custom-post-type-ui --activate ; wp plugin install timber-library --activate ; wp plugin install woocommerce --activate ; cd .. ; cd aside ; wp core update ; wp plugin update --all; wp theme update --all ; wp plugin delete hello ; wp plugin delete akismet ; wp plugin install custom-post-type-ui --activate ; wp plugin install timber-library --activate ; cd .. ; cd zwicker ; wp core update ; wp plugin update --all; wp theme update --all ; wp plugin delete hello ; wp plugin delete akismet ; wp plugin install custom-post-type-ui --activate ; wp plugin install timber-library --activate ; cd .. ; cd humboldt ; wp core update ; wp plugin update --all; wp theme update --all ; wp plugin delete hello ; wp plugin delete akismet ; wp plugin install custom-post-type-ui --activate ; wp plugin install timber-library --activate ; cd .. ; cd particitype ; wp core update ; wp plugin upd
View gist:52f07bb61c295daf50e2c0237875680e
sudo apt-get install git
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
cd Documents/
https://github.com/awesomephant/sineMachine.git
View getRandomInt.js
const gra = function(min, max) {
return Math.random() * (max - min) + min;
}
const gri = function(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
View mapRange.js
var mapRange = function(n, range, targetRange) {
var x =
(n - range[0]) / (range[1] - range[0]) * (targetRange[1] - targetRange[0]) +
targetRange[0];
return x;
};
@awesomephant
awesomephant / loadChessData.js
Created Mar 23, 2017
Casper.js script to load chess openings
View loadChessData.js
var fs = require('fs')
var casper = require('casper').create();
casper.options.waitTimeout = 10000;
var games;
var count = 0;
var nextLink = 'http://www.chessgames.com/perl/chess.pl?tid=53788';
var parsePage = function () {
var rows = document.querySelectorAll('table[cellpadding="3"]:nth-of-type(2) tr');
var games = [];
You can’t perform that action at this time.