Skip to content

Instantly share code, notes, and snippets.

$.fn.scrollLock=function(){return $(this).on("DOMMouseScroll mousewheel",function(h){var g=$(this),f=this.scrollTop,d=this.scrollHeight,b=g.height(),i=h.originalEvent.wheelDelta,a=i>0,c=function(){h.stopPropagation();h.preventDefault();h.returnValue=false;return false};if(!a&&-i>d-b-f){g.scrollTop(d);return c()}else{if(a&&i>f){g.scrollTop(0);return c()}}})};$.fn.scrollRelease=function(){return $(this).off("DOMMouseScroll mousewheel")};
@appel
appel / bookmarklet.js
Last active February 2, 2017 22:32
Turbolinks.js bookmarklet (via CDNJS)
javascript:void((function()%7Bvar e=document.createElement('script');e.setAttribute('src','https://cdnjs.cloudflare.com/ajax/libs/turbolinks/5.0.0/turbolinks.min.js');document.body.appendChild(e)%7D)());console.log('Turbolinks.js loaded.');
@appel
appel / userstyle.lite.cnn.io.css
Last active February 7, 2018 15:11
Userstyle to make lite.cnn.io just a tad easier on the eyes (IMHO) https://news.ycombinator.com/item?id=15211976
@-moz-document domain("lite.cnn.io") {
@import url(//fonts.googleapis.com/css?family=Open+Sans);
body
{
font-family: 'Open Sans', sans-serif;
color: #333;
font-size: 120%;
line-height: 140%;
@appel
appel / address-lookup.js
Last active May 3, 2018 14:57 — forked from luk3thomas/address-lookup.js
jQuery address lookup
;(function($, google, window, document, undefined){
var pluginName = "addressLookup",
defaults = {
"namespace": "al" ,
"input": "#address-lookup"
};
function Plugin(element, options) {
this.element = element;
@appel
appel / background-scroll.js
Last active April 5, 2019 20:22 — forked from cheh/background-scroll.js
Slow down background image scroll speed
var body = document.body,
doc = document.documentElement,
hAlign = 'center',
divideBy = 4;
$(window).scroll(function()
{
body.style.backgroundPosition = hAlign + " " + (0 - (Math.max(doc.scrollTop, body.scrollTop) / divideBy)) + "px";
});
@appel
appel / notepad2-solarized.ini
Created August 9, 2019 16:39 — forked from gene-pavlovsky/notepad2-solarized.ini
Solarized Dark and Light color schemes for Notepad2-mod
[Default Text]
FileNameExtensions=txt; text; wtx; log; asc; doc; diz; nfo
Default Style=font:Consolas; size:11; fore:#93a1a1; back:#002b36
Margins and Line Numbers=size:-1; fore:#657b83; back:#073642
Matching Braces=size:+1; bold; fore:#dc322f; back:#073642
Matching Braces Error=size:+1; underline; fore:#dc322f; back:#073642
Control Characters (Font)=size:-1
Indentation Guide (Color)=fore:#073642
Selected Text (Colors)=eolfilled; fore:#eee8d5; back:#586e75
Whitespace (Colors, Size 0-5)=fore:#d33682
@appel
appel / bookmarklet.html
Created August 23, 2020 11:37 — forked from codepunkt/bookmarklet.html
Toggle Style-Elements
<a href="javascript:(function(d,g,a,b,c,e,f,h,n,t,u,w,x){f=function(e,o,k){for(k in o)e.setAttribute(k,o[k])};c=function(e){return d.createElement(e)};n=function(s){return d.createTextNode(s)};a=function(e,c,k){for(k in c)e.appendChild(c[k])};w=c(g);h=c(g);t=n('Toggle Style-Elements');u=c('ul');b=d.querySelector('body');x='position:fixed;top:0;right:0;z-index:99999;margin:0;padding:0;background:#f4fff4;color:#99ad85;font:14px Helvetica,Arial,sans-serif;border:1px solid #bada55;border-top-width:0;border-right-width:0;border-bottom-left-radius:10px;';e=d.getElementById('tcss');if(b&&e)f(e,{style:x+(e.style.display=='none'?'':'display:none')});else if(b){f(w,{id:'tcss',style:x});f(h,{style:'font:20px Georgia,serif;padding:10px;margin:0;background:#dae7da;color:#693'});f(u,{style:'margin:0;padding:10px;list-style-type:disc'});f(u,{style:'margin:0;padding:10px;list-style-type:disc;'});a(b,[w]);a(w,[h,u]);a(h,[t]);[].slice.call(d.styleSheets).forEach(function(s,i,l,m,y,z){y='margin:0 0 0 20px;padding:0;cursor:point
@appel
appel / dark-google.user.css
Created February 18, 2021 19:37
Dark Google
html{font-family:arial,sans-serif}html{-webkit-filter:none}body.srp,body{background:#202124}img,[role=img],video,iframe{-webkit-filter:none}body,h1{font-family:arial,sans-serif;font-size:14px;}h1{font-weight:normal;margin:0;padding:0}h3{font-size:medium;font-weight:normal;margin:0;padding:0}body{margin:0;color:#ddd;}a{color:#a0b7f6;text-decoration:none;-webkit-tap-highlight-color:rgba(255,255,255,.10)}a:visited{color:#C58AF9}a:hover{text-decoration:underline}a:hover h3{text-decoration:underline}cite,cite a:link,cite a:visited{color:#bdc1c6;font-style:normal}button{margin:0}ol li{list-style:none}ol,ul,li{margin:0;padding:0}input{font-family:arial,sans-serif;font-size:14px}em{font-weight:bold;font-style:normal}.aCOpRe em,.st em{color:#bcc0c3}.aCOpRe a em,.st a em{color:inherit}.u9DLmf{}.mfMhoc{}.DsryEe{color:#fff !important;text-transform:none !important}.V88cHc{}.wf-b .mfMhoc,.wf-b .DsryEe,.wf-b .V88cHc{font-family:Google Sans,arial,sans-serif !important}.wf-b .u9DLmf{font-family:Google Sans,arial,sans-serif !
@appel
appel / index.html
Created August 2, 2021 19:43 — forked from jsanta/index.html
PWA index.html file for Android and iOS copy & paste enabled
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Ionic App</title>
<base href="/" />
<meta
name="viewport"
@appel
appel / search-engines-import-export-chrome-edge-brave.md
Last active October 29, 2024 01:00
Export and import search engines from Chrome/Edge to Brave (bonus: Firefox to Firefox)

Export and import search engines from Chrome/Edge/Brave to Chrome/Edge/Brave

Bonus: Firefox to Firefox, see instructions at the bottom

As discussed here: brave/brave-browser#695

Thanks to the excellent answer by @Redsandro I was able to do this on Windows, which I'll document below because my future self will inevitably find this via Google a few years from now. Since it's using SQLite it should not be too hard to adapt for Macos and Linux.

Edit: this method still worked as of 9/3/2023. :)