Skip to content

Instantly share code, notes, and snippets.

Grant grantwinney

View GitHub Profile
View motion_sensor_file_deobfuscated.js
var _cf = _cf || [],
bmak = bmak || {
ver: 1.54,
ke_cnt_lmt: 150,
mme_cnt_lmt: 100,
mduce_cnt_lmt: 75,
pme_cnt_lmt: 25,
pduce_cnt_lmt: 25,
tme_cnt_lmt: 25,
tduce_cnt_lmt: 25,
View motion_sensor_file_obfuscated.js
var _ac=["\x61\x6a\x5f\x69\x6e\x64\x78\x5f\x74\x61\x63\x74","\x62\x69\x6e\x64","\x64\x72\x69\x76\x65\x72","\x64\x6f\x65\x5f\x63\x6e\x74","\x6d\x6f\x75\x73\x65\x64\x6f\x77\x6e","\x42\x61\x74\x61\x6e\x67","\x63\x6c\x69\x65\x6e\x74\x48\x65\x69\x67\x68\x74","\x65\x6d\x69\x74","\x69\x6e\x64\x65\x78\x4f\x66","\x65\x6e\x52\x65\x61\x64\x44\x6f\x63\x55\x72\x6c","\x50\x61\x6c\x61\x74\x69\x6e\x6f","\x66\x70\x56\x61\x6c\x73\x74\x72","\x6f\x6e\x70\x6f\x69\x6e\x74\x65\x72\x75\x70","\x22","\x64\x6d\x5f\x65\x6e","\x2f\x67\x65\x74\x5f\x70\x61\x72\x61\x6d\x73","\x72\x56\x61\x6c","\x72\x65\x74\x75\x72\x6e\x2f\x2a\x40\x63\x63\x5f\x6f\x6e\x21\x40\x2a\x2f\x21\x31","\x2d\x31\x2c\x32\x2c\x2d\x39\x34\x2c\x2d\x37\x30\x2c","\x68\x74\x74\x70\x3a\x2f\x2f","\x73\x74\x6f\x72\x61\x67\x65","","\x6f\x6e\x6b\x65\x79\x70\x72\x65\x73\x73","\x6e\x61\x76\x69\x67\x61\x74\x6f\x72","\x6d\x6e\x5f\x75\x70\x64\x61\x74\x65\x5f\x63\x68\x61\x6c\x6c\x65\x6e\x67\x65\x5f\x64\x65\x74\x61\x69\x6c\x73","\x6b\x65\x79\x64\x6f\x77\x6e","\x73\x70\x61\x77\x6e","\x62\
@grantwinney
grantwinney / twitter-tamer.css
Created Feb 12, 2020
Hide elements of the Twitter UI
View twitter-tamer.css
@-moz-document url-prefix("https://twitter.com") {
/* LEFT COLUMN NAVIGATION */
header[role="banner"], /* HIDE ENTIRE COLUMN */
[aria-label="Twitter"], /* logo */
[data-testid="AppTabBar_Home_Link"], /* home */
[data-testid="AppTabBar_Explore_Link"], /* explore */
[data-testid="AppTabBar_Notifications_Link"], /* notifications */
[data-testid="AppTabBar_DirectMessage_Link"], /* messages */
[aria-label="Bookmarks"], /* bookmarks */
[aria-label="Lists"], /* lists */
@grantwinney
grantwinney / se-simplified.json
Last active Oct 23, 2019
A Stylus template for hiding all the cruft on the StackExchange / StackOverflow network
View se-simplified.json
[
{
"enabled": true,
"updateUrl": null,
"md5Url": null,
"url": null,
"originalMd5": null,
"installDate": 1571792931541,
"name": "SE Simplified",
"sections": [
@grantwinney
grantwinney / whatcomments1.cs
Created Aug 3, 2018
an example for a blog post - comments on what
View whatcomments1.cs
public static void Main()
{
// get account details
var accountId = "1234";
var name = "Grant";
var balance = 100m;
var secretAnswer = "42";
// validate the user in secretive fashion
var answer = "";
@grantwinney
grantwinney / whatcomments2.cs
Created Aug 3, 2018
an example for a blog post - comments on what, revisited
View whatcomments2.cs
public static void Main(string[] args)
{
var accountId = "1234";
ValidateUser(accountId);
var action = GetTransactionType(accountId);
var amount = GetTransactionAmount(accountId);
ShowTransactionAndBalance(accountId, action, amount);
@grantwinney
grantwinney / mentor.sh
Last active Aug 7, 2018
A script to make mentoring C# solutions on Exercism a little easier
View mentor.sh
#!/bin/bash
### check for proper usage
if [ $# -ne 1 ]; then
echo $0: usage: uuid_for_solution
exit 1
fi
cd ~
@grantwinney
grantwinney / url-updater.py
Last active Jun 20, 2018
Reads in a list of URLs (from a CSV file), writes any redirected URLs to a new CSV file, and prints out missing (404) URLs to the console
View url-updater.py
import csv
import urllib2
with open('urls.csv', 'rb') as f:
reader = csv.reader(f)
with open('urls-output.csv', 'w') as g:
writer = csv.writer(g, delimiter=',')
for row in reader:
url = row[0]
try:
@grantwinney
grantwinney / utils.erl
Last active Sep 26, 2017
Erlang utilities. Concatenates mixed list of values (binaries/strings/atom/integer/float) into a single binary or string.
View utils.erl
-module(utils).
-export([concat/2]).
%% EXTERNAL
concat(Words, string) ->
internal_concat(Words);
concat(Words, binary) ->
list_to_binary(internal_concat(Words)).
@grantwinney
grantwinney / ghost_edit_bookmarklet.txt
Last active Apr 13, 2018
A little "edit page" bookmarklet if you're using the Ghost blog. Redirects URL to /edit. Just save it as a new bookmark.
View ghost_edit_bookmarklet.txt
javascript:let%20u=window.location.href;if(u.indexOf('grantwinney.com')!==-1&&!(u.endsWith('.com/'))&&u.indexOf('ghost/#/editor')===-1){window.location.href=window.location.protocol+window.location.pathname+'/edit';}
You can’t perform that action at this time.