Skip to content

Instantly share code, notes, and snippets.

@sfinktah
sfinktah / python.snippets
Last active Aug 20, 2021
UltiSnips auto-completions that don't expand in comments
View python.snippets
global !p
pythonZones = [ 'pythonStatement', 'pythonConditional', 'pythonRepeat',
'pythonOperator', 'pythonException', 'pythonInclude', 'pythonAsync',
'pythonDecorator', 'pythonDecoratorName', 'pythonFunction',
'pythonTodo', 'pythonString', 'pythonRawString', 'pythonQuotes',
'pythonTripleQuotes', 'pythonEscape', 'pythonNumber', 'pythonBuiltin',
'pythonExceptions', 'pythonSpaceError', 'pythonDoctest', 'pythonDoctestValue']
commentZones = ['pythonComment']
pythonZoneIds = vim.eval('map('+str(pythonZones)+", 'hlID(v:val)')")
commentZoneIds = vim.eval('map('+str(commentZones)+", 'hlID(v:val)')")
View stackoverflow.user.js
// ==UserScript==
// @name New script - stackoverflow.com
// @namespace SO Code Context Highlight
// @match https://stackoverflow.com/questions/*
// @downloadURL https://nt4.com/monkey/stackoverflow.user.js
// @version 0.5
// @description visual studio style highlight of terms matching cursor(mouse) position
// @author sfinktah
// @require https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.11.0/underscore-min.js
// @grant GM_addStyle
View PlayerList.java
package viewmodel;
import model.interfaces.Player;
import util.StringHelpers;
import javax.swing.*;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.*;
@sfinktah
sfinktah / PlayerWrapper.java
Created Oct 15, 2020
PlayerWrapper PlayerWrapper
View PlayerWrapper.java
package viewmodel;
import model.interfaces.Player;
import util.StringHelpers;
import java.awt.*;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.HashMap;
@sfinktah
sfinktah / ActionRouter.java
Created Oct 12, 2020
A slots and signals variation for ActionEvent/ActionListener
View ActionRouter.java
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
import java.util.Map;
/**
* A routing table for Observers and Observables.
*
* Effectively allows routing of an {@link ActionEvent}. Charmingly reminiscent
@sfinktah
sfinktah / Debug.java
Created Oct 10, 2020
Ultra-light Java Debugging Class
View Debug.java
public class Debug {
public static boolean DEBUG = true;
public static void format(String format, Object... args) {
println(String.format(format, args));
}
public static void println(String s) {
if (DEBUG) {
@sfinktah
sfinktah / .domverticies.js
Last active Apr 27, 2018 — forked from abernier/.gitignore
domvertices.js
We couldn’t find that file to show.
View 0x1a098062.2018-04-13.json
{
"version": 1,
"format": 0,
"poolSize": 2000,
"bonus": [
[1615036418, 1733199191, 260605391, 3504918091, 1732544373],
[-80731107, -65986214, -596172024, 1268476500, -63495318],
[-1275684852, -1262641823, -395993871, 56481349, -1259233413],
[724218125, 739947643, 1152759112, 2608987972, 741193338],
[-1864060701, -1746487882, -376982118, 542113450, -1746684012],
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
margin: 0;
}
.info {
position: absolute;
@sfinktah
sfinktah / index.html
Created Sep 21, 2016 — forked from anonymous/index.html
JS Bin Process Chrome stack trace into detailed call tree // source http://jsbin.com/rapoxo
View index.html
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Process Chrome stack trace into detailed call tree">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://nt4.com/js/dev"></script>