Skip to content

Instantly share code, notes, and snippets.

View simonwjackson's full-sized avatar
🎯
Focusing

Simon W. Jackson simonwjackson

🎯
Focusing
View GitHub Profile
@simonwjackson
simonwjackson / ebay-average-price.js
Last active September 28, 2020 21:36
Get the average price of a search on ebay
/************************************************
* Utils
************************************************/
const injectScript = url =>
document.body.appendChild(document.createElement('script')).src = url
const querySelectorAllArray = selector =>
[...document.querySelectorAll(selector)]
@simonwjackson
simonwjackson / index.js
Last active March 18, 2019 04:37
Recipe scaler
const R = require('ramda')
const recipie = {
ingredients: [{
name: 'butter',
weight: 100
}, {
name: 'salt',
weight: 25
}]
@simonwjackson
simonwjackson / index.js
Created February 23, 2019 10:18
Ramda -> Anki
(function () {
return [...$$('.card')]
.map(el => {
const code = $(':scope pre code', el)
.outerHTML
.replace(/\n/gmi, '<br>')
const description = [...$$(':scope > .description > :not(pre)', el)]
const summary = description
.splice(0, 1)[0]
.outerHTML
@simonwjackson
simonwjackson / custom.css
Last active March 22, 2018 13:31
Vivaldi CSS
/* %AppData%\Local\Vivaldi\Application\<version>\resources\vivaldi\style */
#tabs-container .toggle-trash,
.button-tabbar.newtab,
#main > div.toolbar-addressbar.toolbar > div.toolbar > button {
display: none !important;
}
#titlebar .application-icon {
opacity: .33;
@simonwjackson
simonwjackson / tau-custom.css
Last active October 27, 2017 18:21
Tizen UI
.content-padding {
padding-top: 16px;
padding-bottom: 16px;
padding-left: 30px;
padding-right: 30px;
}
.button-group-height {
height: 72px;
}
@simonwjackson
simonwjackson / vimify.js
Last active October 17, 2017 14:44
Vimify
// ==UserScript==
// @name Vimify
// @namespace http://miniarray.com
// @version 0.1
// @description Vimify textarea inputs
// @author You
// @match https://glitch.com/edit/*
// @grant none
// ==/UserScript==
// ;(function(options) {
command('reddit', 'reddit list', ([sub]) => {
if (!sub) sub = 'top'
else sub = `r/${sub}`
const subreddit = `https://www.reddit.com/${sub}.json?sort=top&t=day`
function reddit2list(json) {
return json.data.children.map(child => ({
title: child.data.title.trim(),
@simonwjackson
simonwjackson / surfing.keys.js
Last active September 16, 2019 14:34
Surfing Keys
/*
* Headings: http://www.network-science.de/ascii/ascii.php?x=22&y=4&FONT=small&RICH=no&FORM=left&STRE=no&WIDT=80&TEXT=<YOUR_TEXT_HERE>
* Font: small
*/
/*
const plugins = [{
url: 'https://gist.githubusercontent.com/simonwjackson/56fff7941db54c4afb7ff286b74ec401/raw/reddit.sk.js',
name: 'reddit',
options: {}
@simonwjackson
simonwjackson / index.html
Last active February 18, 2017 14:48
Game Packery with left nav // http://jsbin.com/gamafuk
<!DOCTYPE html>
<html>
<head>
<meta content="Game Packery with left nav" name="description">
<meta charset="utf-8">
<meta content="width=device-width" name="viewport">
<title>
JS Bin
</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.3.1/css/bulma.min.css" rel="stylesheet" type="text/css">
@simonwjackson
simonwjackson / index.html
Last active February 16, 2017 22:42 — forked from anonymous/index.html
Spatial Navigation with selected element always in view // source http://jsbin.com/mucoses
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>JavaScript SpatialNavigation Demo Page</title>
<script>
function isElementInViewport (el) {
//special bonus for those using jQuery