Skip to content

Instantly share code, notes, and snippets.

View Bestulo's full-sized avatar

Besto Bestulo

View GitHub Profile
@Bestulo
Bestulo / ltplugin.user.js
Created November 22, 2016 10:08
plugin for LT
$(document).ready(function(){
var $songLink = $('li.song-node-info-album').find('a').attr("href");
var $tabs = $('ul.tabs');
$.ajax({
type: 'GET',
url: $songLink,
success: function(res){
$(res).find('.green_tab').each(function(){
$tabs.append($(this));
});
@Bestulo
Bestulo / Common-Currency.json
Created December 8, 2017 03:42 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@Bestulo
Bestulo / gist:33a43f8e8884919a1ccd95bfc3dd8bd8
Created December 10, 2017 07:27
Failed login attempt to zerobias/telegram-mtproto
const {MTProto} = require('telegram-mtproto')
const fs = require('fs-extra')
const vars = JSON.parse(fs.readFileSync('secrets'))
const {phone, api_id, hash} = vars.userbot
const prompt = require('prompt-promise')
const api = {
layer: 57,
api_id: api_id
}
@Bestulo
Bestulo / cap-all-lines.js
Last active December 26, 2018 01:59
Each line's first letter to uppercase (lines.split('\n').firstToUpper)
const { head, tail, toUpper } = require('ramda')
const text = `det var två ädla konungabarn
som lova varandra sin tro
och den som då skulle svika`
/* =>
Det var två ädla konungabarn
Som lova varandra sin tro
Och den som då skulle svika
@Bestulo
Bestulo / index.pug
Created March 1, 2019 16:22
Under Construction
- var objects = ['line lineOne', 'line lineTwo', 'line lineThree', 'stand', 'weight', 'cabin', 'arm']
- var n = 0
#content
h1 < building />
p Working day and night!
#outerCraneContainer
.buildings
while n < 5
@Bestulo
Bestulo / power-of-one.md
Last active January 9, 2020 01:22
Summary of "The Power of One" by AWAI

Summary of "The Power of One" by AWAI

Content extracted from The Secret Formula for Making Six-Figures from Home --- Writing Letters. Chapter 5 "The Secret To Good Writing".

Mark Morgan Ford writes:

It struck me that readers didn’t want to hear everything I had to say about a topic every time I wrote. They were looking for a single, useful suggestion or idea that could make them more successful.

Power of One:

@Bestulo
Bestulo / letter-structure-analysis.md
Created January 9, 2020 01:24
Analysis of AWAI's Letter Structure

Letter Structure Analysis

Examples at the end of this document.

3 rules:

  1. People don't like being sold
  2. People buy things for emotional, not rational, reasons
  3. Once sold, people need to satisfy their emotional decisions with logic
@Bestulo
Bestulo / pinboard.css
Created January 11, 2020 19:36
pinboard.in custom theme
/* Theme Name: Flat Pinboard */
/* Theme URL: http://tackk.com/flat-pinboard */
/* Version: v1.0.1 */
/* Created by: Dan Klammer */
/* Broswer: Chrome + Stylish Extension */
/*
THEME SOURCE: https://gist.github.com/jfred/c5fe00da60a19ff74999223e9a451586
@Bestulo
Bestulo / pinboard.css
Last active January 11, 2020 19:39
pinboard.in custom theme
/* Theme Name: Flat Pinboard */
/* Theme URL: http://tackk.com/flat-pinboard */
/* Version: v1.0.1 */
/* Created by: Dan Klammer */
/* Broswer: Chrome + Stylish Extension */
/*
THEME SOURCE: https://gist.github.com/jfred/c5fe00da60a19ff74999223e9a451586
COLORS INVERTED WITH: https://jalu.ch/coding/css-negative.php
@Bestulo
Bestulo / node-polcomp-flair-counter.js
Created June 11, 2020 16:41
Node.js PoliticalCompassMemes flair counting tool
const rp = require('request-promise')
const fs = require('fs')
const baseUrl = 'https://www.reddit.com/r/PoliticalCompassMemes/.json'
const getPCM = (after = '') =>
rp(baseUrl + (after ? '?after=' + after : after)).then(JSON.parse)
const mergeCounters = (arr1, arr2) => {
if (arr1 && arr2) {