Skip to content

Instantly share code, notes, and snippets.

@ViktorQvarfordt
ViktorQvarfordt / http.js
Created Dec 31, 2017
VanillaJS HTTP Requests
View http.js
// VanillaJS convenience methods for making HTTP requests.
window.http = (() => {
const logger = (err, data) => {
console.log(err || data)
}
const handleResponse = (req, cb) => {
let data
@ViktorQvarfordt
ViktorQvarfordt / linkify.user.js
Last active Oct 9, 2017
Linkify SC issue posts
View linkify.user.js
// ==UserScript==
// @name Linkify SC issue posts
// @version 1
// @author VQV
// @match https://vvo.vpd.se/SupportCentre/Issue/Details/*
// ==/UserScript==
setTimeout(function() {
$("td").each(function(e) {
View latex_to_unicode.py
import sublime, sublime_plugin
import sys, io, re
class LatexToUnicode(sublime_plugin.TextCommand):
def run(self, edit, latex=None):
if not latex:
if self.view.sel()[0].begin() == self.view.sel()[0].end():
region = self.view.line(self.view.sel()[0])
else:
region = self.view.sel()[0]
View putlocker-enhancements.user.js
// ==UserScript==
// @name Putlocker enhancements
// @match http://putlocker.is/*
// ==/UserScript==
// INSTALL: https://gist.githubusercontent.com/ViktorQvarfordt/41d16d69162153c5f1a9853a794d9b06/raw/putlocker-enhancements.user.js
var epUrl = window.location.href
var epUrlPrev = epUrl.replace(/episode-(\d+)/, (match, p1) => `episode-${parseInt(p1)-1}`)
var epUrlNext = epUrl.replace(/episode-(\d+)/, (match, p1) => `episode-${parseInt(p1)+1}`)
@ViktorQvarfordt
ViktorQvarfordt / trello-mathjax.user.js
Last active Jan 22, 2019
Apply Mathjax to Trello
View trello-mathjax.user.js
// ==UserScript==
// @name MathJax Trello
// @description Apply Mathjax to Trello
// @include https://trello.com/*
// @grant none
// ==/UserScript==
// INSTALL: https://gist.githubusercontent.com/ViktorQvarfordt/c3f89c3cf50e3dc60b23257294af5710/raw/trello-mathjax.user.js
if (window.MathJax === undefined) {
@ViktorQvarfordt
ViktorQvarfordt / google-search-tweaks.user.js
Last active Feb 25, 2017
Google search tweaks. User script. Shortcuts for selecting search results. Block ads and sponsored links.
View google-search-tweaks.user.js
// ==UserScript==
// @name Google search tweaks
// @description Shortcuts for selecting search results. Block ads and sponsored links.
// @author Viktor Qvarfordt
// @include /^https?:\/\/(www\.)?google.[^./]+\/search.*/
// @version 2016-08-21
// @grant none
// ==/UserScript==
// INSTALL: https://gist.github.com/ViktorQvarfordt/1d81cbf5a5bebbaaee90/raw/google-search-tweaks.user.js
@ViktorQvarfordt
ViktorQvarfordt / README.md
Last active Nov 30, 2018
ember-component-ace-editor
View README.md

Ace editor component for Ember.

  • A two-way binding is set up between value and the text in the editor.
  • Configure Ace in the aceInit callback.

Template

{{ace-editor value=value aceInit=aceInit class="editor"}}