Skip to content

Instantly share code, notes, and snippets.

ᐽи𝔡Ʀẚƽ Ꭾ𐐪ɼᒇτĸ∂
🜁ᴒᕍⴽᓈς ᕈ⧜☈ᖙﺎ🕂⛏Ꮹ
@andraaspar
andraaspar / re.txt
Last active March 21, 2017 08:11
RegEx for replacing quotes with backticks in ES6
'
`
from `([^`]*)`
from '$1'
`([^`]*)`:
'$1':
@andraaspar
andraaspar / webpack.debug.config.js
Last active April 19, 2017 11:55
Replace __WEBPACK_IMPORTED_MODULE_ in Webpack output
const baseConfig = require('./webpack.config.js')
const RawSource = require('webpack-sources').RawSource
baseConfig.plugins.push(function() {
this.plugin('emit', (compilation, callback) => {
compilation.chunks.forEach((chunk) => {
chunk.files.filter((filename) => /\.js$/.test(filename)).forEach((filename) => {
var source = compilation.assets[filename].source()
compilation.assets[filename] = new RawSource(source.replace(/__WEBPACK_IMPORTED_MODULE_/g, '__'))
@andraaspar
andraaspar / IAttributes.ts
Last active July 20, 2017 11:03
Mithril helpers
import { TMithrilEvent } from './TMithrilEvent'
export interface IAttributes {
id?: string
class?: string
style?: string | {[_: string]: any}
href?: string
target?: string
download?: string,
type?: string
@andraaspar
andraaspar / spotify-ratings.user.js
Last active March 16, 2023 15:46
Spotify ratings
// ==UserScript==
// @name Spotify ratings
// @namespace 50edea63-8324-74b3-4019-81e0bdcd316a
// @version 0.2.0
// @description Loads my ratings for an album.
// @author AP
// @match https://open.spotify.com/*
// @run-at document-idle
// ==/UserScript==
Word Owl App Privacy Policy
We do not collect any data from Word Owl. Any information you enter into the application is kept locally on your device.
@andraaspar
andraaspar / tslint.json
Created November 30, 2017 17:40
TSLint rules
{
"defaultSeverity": "error",
"extends": [],
"jsRules": {},
"rules": {
"no-unused-variable": {
// Disallows unused imports, variables, functions and private class members.
"options": [true, { "ignore-pattern": "Vnode" }],
"severity": "warning"
},
// ==UserScript==
// @name HN
// @namespace andraaspar
// @version 0.1.1
// @description Colors visited links
// @author AP
// @match https://news.ycombinator.com/*
// @run-at document-idle
// @grant GM_addStyle
// ==/UserScript==
@andraaspar
andraaspar / web-timesheet.userscript.js
Last active August 14, 2019 09:23
Replicon Web TimeSheet
// ==UserScript==
// @name Web Timesheet
// @namespace andraaspar
// @version 0.3.2
// @description Tweaks.
// @author AP
// @match http://na1.replicon.com/ovitas/*
// @run-at document-idle
// @require https://code.jquery.com/jquery-3.2.1.slim.min.js
// @grant GM.setValue
module.exports = {
trailingComma: 'es5',
tabWidth: 4,
useTabs: true,
semi: false,
singleQuote: true,
jsxSingleQuote: true,
}