AutoHotKey (i can show you how to use it)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function run { | |
Start-Process $args[0] -ArgumentList ( | |
$args[1..$args.Length] -join " " | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" add all builtin keywords and methods/attributes to syntax | |
" put in $VIM/vimfiles/after/syntax/python.vim | |
if exists('b:loaded_pythoncustomsyntax') | |
finish | |
endif | |
let b:loaded_pythoncustomsyntax=1 | |
syn keyword pythonExceptions ModuleNotFoundError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// these are usually defined in math.h ... | |
#define NAN 0.0 | |
// actually a bit smaller than DBL_MAX | |
#define INFINITY 1e+308 | |
/** | |
* atof as described in ISO/IEC 9899:2011 (the C11 standard) | |
* | |
* case-insensitive input syntax EBNF: | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function currency { | |
Begin { | |
# make sure we can use Web.HttpUtility | |
Add-Type -AssemblyName System.Web | |
} | |
Process { | |
$encoded = [Web.HttpUtility]::UrlEncode($args -join " ") | |
$response = Invoke-WebRequest ` | |
"https://google.com/search?q=$encoded" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# matricies that increase from left to right and top to bottom | |
import random | |
import math | |
def matrix(width, max_increase=3, max_seed=10): | |
""" | |
width: matrix width > 0 | |
max_increase: the maximum increase between a cell and its lower / right | |
neighbors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function global:prompt { | |
$dir = (Get-Location).Path | |
# length being replaced | |
$len = $dir.Replace($Env:UserProfile, '~').Length | |
# name | |
$name = $null | |
Get-ChildItem Env: | %{ | |
# length of replacing the value of $_ with $... in $dir | |
# add 1 for '$' | |
$newLen = $dir.Length - $_.Value.Length + $_.Name.Length + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# code for determining how much of a word is typed with different hands in a given keyboard layout | |
# for the corncob list (http://www.mieliestronk.com/corncob_lowercase.txt), i got: | |
# >>> fingerstats.wordsfile('corncob.txt', fingerstats.qwerty) | |
# the left hand typed 59.29% of the letters | |
# the right hand typed 40.71% | |
# | |
# >>> fingerstats.wordsfile('corncob.txt', fingerstats.colemak) | |
# the left hand typed 50.56% of the letters | |
# the right hand typed 49.44% | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.DESCRIPTION | |
Moves the mouse cursor 1 pixel to the right and then back if the user hasn't | |
touched the computer in a bit | |
.PARAM CheckInterval | |
Interval between checks for idle-ness, in seconds. Default: 9.75 minutes | |
.PARAM MaxIdleTime | |
Maximum time since last input to trigger a mouse move, in seconds. Default: 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.whatever</groupId> <!-- this identifies you --> | |
<artifactId>pom-boilerplate</artifactId> <!-- this identifies the project --> | |
<version>1.0.0</version> | |
<properties> | |
<java.version>1.8</java.version> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |