Skip to content

Instantly share code, notes, and snippets.

View jh3y's full-sized avatar
🔨
Crafting

Jhey Tompkins jh3y

🔨
Crafting
View GitHub Profile
@jh3y
jh3y / footer.jade
Created September 29, 2014 20:45
Jade mixin for github stats footer on project page
@jh3y
jh3y / shelf.jsx
Created March 31, 2016 22:01
React Shelf component for displaying GitHub repos for given user
class Shelf extends React.Component {
componentDidMount () {
this.intervals = [];
}
componentWillUnmount () {
this.intervals.map(clearInterval);
}
setInterval () {
this.intervals.push(setInterval.apply(null, arguments));
}
@jh3y
jh3y / webpack.config.babel.js
Last active September 22, 2016 22:59
Basic webpack configuration
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const autoprefixer = require('autoprefixer');
const webpack = require('webpack');
const path = require('path');
const IS_DIST = (process.argv.indexOf('--dist') !== -1) ? true : false;
const config = {
devServer: {
@jh3y
jh3y / carousel.css
Last active October 5, 2016 14:40
Pure CSS carousel exploration
@jh3y
jh3y / serve.js
Last active August 19, 2018 19:04
serve.js
const browsersync = require('browser-sync'),
vf = require('vinyl-file'),
vss = require('vinyl-source-stream'),
vb = require('vinyl-buffer');
const start = () => {
const server = browsersync.create();
server.init({
baseDir: 'public/'
});
@jh3y
jh3y / focussed-twitter.js
Created July 25, 2019 00:59
Bookmarklet for "Focussed Twitter" 🐦
// Create a new bookmark in your browsers' Bookmark Manager pointing at the following script:
javascript:(function(){let a;const b=new CSSStyleSheet;b.insertRule("header, [data-testid=\"sidebarColumn\"] { transition: opacity .5s ease; }"),b.insertRule(".fade-noise header, .fade-noise [data-testid=\"sidebarColumn\"] { opacity: 0.005; }"),document.adoptedStyleSheets=[b];const c=()=>{document.body.classList.add("fade-noise"),a&&clearTimeout(a),a=setTimeout(()=>{document.body.classList.remove("fade-noise")},2500)};window.addEventListener("scroll",c)})();
// NOTE:: You can modify the behavior by updating the values in the injected CSS
// 1. transition time for opacity (0.5s default)
// 2. opacity of non-focussed items (0.05 default)
// 3. time it takes for non-focussed items to return to full opacity (2500ms default)
@jh3y
jh3y / gulpfile.js
Last active August 15, 2019 14:07
gulpfile using gulp 4's series/parallel features
import gulp from 'gulp'
const compileMarkup = () => { // COMPILE MARKUP }
const compileScript = () => { // COMPILE SCRIPT }
const compileStyle = () => { // COMPILE STYLE }
const watchMarkup = () => { // WATCH MARKUP }
const watchScript = () => { // WATCH SCRIPT }
const watchStyle = () => { // WATCH STYLE }
@jh3y
jh3y / index.html
Last active October 21, 2019 17:40
Electron - Get System Information Fiddle
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
<div>
<h1>Get system information</h1>
<i>Supports: Win, macOS, Linux <span>|</span> Process: Both</i>
@jh3y
jh3y / activity-monitor.js
Created November 11, 2019 16:37
Foundation for activity monitor w/ Bangle.js
let buzzing = false
/**
* Hard-coded interval for now is not ideal
*/
const minutes = 10
const interval = minutes * (1000 * 60)
/**
* Can you detect if the Bangle is Buzzing or in Buzz in progress?
@jh3y
jh3y / rings.js
Created November 11, 2019 19:22
Create hypnotising/psychedelic rings
/**
* So you get 240 x 240 so you can technically do different things right?
* Colors?
*/
g.clear()
//g.drawImage(img, 100,100);
class Ring {
constructor() {