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 | |
Fetches wttr.in for a terminal weather report. | |
.LINK | |
http://stknohg.hatenablog.jp/entry/2016/02/22/195644 | |
.LINK | |
http://www.nivot.org/blog/post/2016/02/04/Windows-10-TH2-(v1511)-Console-Host-Enhancements |
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
//License: http://creativecommons.org/publicdomain/zero/1.0/ | |
//see https://blog.xkcd.com/2010/05/03/color-survey-results/ | |
//adapted from: https://xkcd.com/color/rgb.txt | |
//several colors were defined twice once spaces and slashes | |
//were replaced with underscores | |
//those lines have simply been commented out | |
//the most useful ones like COLOR_BLACK and COLOR_BLUE are at the bottom of | |
//the file for some reason. ask randall. idk | |
#define COLOR_CLOUDY_BLUE 0xacc2d9 | |
#define COLOR_DARK_PASTEL_GREEN 0x56ae57 |
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
"a quick vim script for distraction free writing | |
"use :NoDistractions | |
"turns off line numbers etc, shows word count in the ruler, | |
"no status line | |
"only in the current buffer | |
function! NoDistractions() | |
setlocal nolist | |
setlocal laststatus=0 | |
setlocal rulerformat=%{wordcount().words} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>distance estimation</title> | |
</head> | |
<body> | |
<canvas id="canvas"></canvas> | |
<script> | |
//html5 <canvas> pixel shader for javascript |
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
#folder denesting script for powershell | |
#also deletes empty folders | |
#you'll have to run it n times for n levels of nested folders | |
#but it outputs the number of folders denested and deleted | |
#this works for 99% of scenarios, but if you run into an edge case... sorry! | |
function DeNestFolders { | |
$ErrorActionPreference = "Stop" | |
echo "denesting folders!!" | |
$denests = 0 |
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
#Random string generation for passwords etc | |
#defaults to all printable ascii | |
#works either inclusively, building a character palette up from zero with switches like -Numbers | |
#or exclusively, starting with all printable ascii and removing characters, as with -NoNumbers | |
#`Random-String -Numbers $False` and `Random-String -NoNumbers` work the same | |
function Random-String { | |
[CmdletBinding()] | |
Param( | |
[Int]$Length = 16, | |
[Switch]$Letters, |
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
/* functions for trapezoidal, midpoint, and | |
* right/left endpoint approximations of integrals | |
* arguments: | |
* f(t): function to be approximated | |
* t: dependent variable of f(t) | |
* bottom: bottom limit of integration | |
* top: top limit of integration | |
* n: number of samples/slices to be used in approximation | |
*/ |
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 StripStartName { | |
[CmdletBinding()] | |
Param( | |
[String]$Name | |
) | |
ls | %{ | |
if($_.Name.StartsWith($Name)) { | |
ren -LiteralPath "$($_.FullName)" "$($_.Parent.FullName)\$($_.Name.Substring($Name.Length))" | |
} | |
} |
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
" Script that uses Python and the `base64` module to provide base64 decode and | |
" encode commands. It’d be pretty simple to support any other base64 program as | |
" well, as long as it reads from stdin — just replace `python -m base64 -e` with | |
" the encoding command and `python -m base64 -d` with the decoding command. | |
" | |
" Some features this provides: | |
" | |
" * Supports ranges, converts only the current line by default (use | |
" `:%Base64Encode` to encode the whole file, for example, and it’ll work as | |
" expected from within visual mode, although it only converts whole lines) |
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
var els = [], | |
g = { | |
img: document.getElementsByTagName("img")[0], | |
time: 0, | |
amt: 20, | |
amin: 5 /* amp */, | |
amax: 10, | |
ramin: 1 /* rot amp */, | |
ramax: 50, | |
pmin: 1 /* period */, |
OlderNewer