Skip to content

Instantly share code, notes, and snippets.

View binarynate's full-sized avatar

Nate Hill binarynate

View GitHub Profile
@WoLfulus
WoLfulus / Bridge.cs
Last active May 18, 2022 01:55
Bridge
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
using Vuplex.WebView;
namespace UI.Interop
{
@dominictarr
dominictarr / readme.md
Created November 26, 2018 22:39
statement on event-stream compromise

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.

@broros

otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu

@jaytaylor
jaytaylor / react-unexpected-use-of-location.md
Created July 12, 2017 22:44
Solution for "Unexpected use of 'location'" React error.
React: Unexpected use of 'location';

Solution: Use window.location instead of bare location.

@cy-park
cy-park / zip-excluding-specific-directories-and-files.md
Created February 17, 2016 03:13
Zip excluding specific directories and files

Zip excluding specific directories

Exclude .git file and node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/\*

Exclude .git file and files in node_modules directory, but keep node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/**\*
@steve228uk
steve228uk / example.html
Last active February 4, 2024 13:14
Deeplink Youtube
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
window.onload = function() {
@ben-ng
ben-ng / fixPrefixes.m
Created November 14, 2014 20:10
Use UIWebView's `loadHTMLString:baseURL:` and set the baseURL to where your assets are in the app bundle. Then replace all absolute paths in your html/js/css with relative ones using something like the script below. The relative URLs will be loaded relative to the baseURL, whereas absolute ones are loaded relative to the root of the filesystem, …
// This doodad converts absolute paths like "/assets/thing.jpg" into relative ones like "assets/thing.jpg"
NSString * (^fixPrefix)(NSString *, NSString *) = ^NSString *(NSString * input, NSString *prefix) {
NSString *needle = [[@"/" stringByAppendingString:prefix] stringByAppendingString:@"/"];
NSString *replacement = [prefix stringByAppendingString:@"/"];
input = [input stringByReplacingOccurrencesOfString:[@"'" stringByAppendingString:needle] withString:[@"'" stringByAppendingString:replacement]];
input = [input stringByReplacingOccurrencesOfString:[@"\"" stringByAppendingString:needle] withString:[@"\"" stringByAppendingString:replacement]];
input = [input stringByReplacingOccurrencesOfString:[@"(" stringByAppendingString:needle] withString:[@"(" stringByAppendingString:replacement]];
return input;
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git