Skip to content

Instantly share code, notes, and snippets.

View drawcode's full-sized avatar
😎
Shipping product

Ryan Christensen drawcode

😎
Shipping product
View GitHub Profile
@drawcode
drawcode / native-events.css
Created July 26, 2018 19:24
native-events-js
div {
padding:1em;
margin:1em;
background:#dadada;
}
@drawcode
drawcode / generate-ssh-key.sh
Last active July 16, 2018 08:59 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "email@example.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "email@example.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "email@example.com" -f ~/.ssh/mozilla_rsa
@drawcode
drawcode / string.compress.js
Created June 24, 2018 03:05 — forked from fliptopbox/string.compress.js
JavaScript String compression
/*
@fliptopbox
LZW Compression/Decompression for Strings
Implementation of LZW algorithms from:
http://rosettacode.org/wiki/LZW_compression#JavaScript
Usage:
var a = 'a very very long string to be squashed';
var b = a.compress(); // 'a veryāăąlong striċ to bečquashed'
@drawcode
drawcode / visual-studio-code-settings.json
Created February 14, 2018 08:52
visual-studio-code-settings.json
// Place your settings in this file to overwrite the default settings
{
"workbench.colorTheme": "Visual Studio Dark",
"files.associations": {
"*.json.txt": "json"
},
"files.exclude": {
"*/**/**.meta": true,
"*/**/_**.*": true
//"*/**/**.meta": true,
@drawcode
drawcode / gist:077fafd287b420e906c75d7071e21c60
Created December 6, 2017 06:26 — forked from ichord/gist:9808444
demo of using pdf.js to extract pages to images
<script src="http://cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.1/processing-api.min.js"></script><html>
<!--
Created using jsbin.com
Source can be edited via http://jsbin.com/pdfjs-helloworld-v2/8598/edit
-->
<body>
<canvas id="the-canvas" style="border:1px solid black"></canvas>
<input id='pdf' type='file'/>
<!-- Use latest PDF.js build from Github -->
@drawcode
drawcode / git-submodules.cmd
Last active June 5, 2017 10:07
git submodules add/remove
# ADD
git submodule add git@bitbucket.org:drawcode/lib-vr-base.git unity-game/Assets/_app/code/libs/lib-vr-base
git submodule init unity-game/Assets/_app/code/libs/lib-vr-base
git submodule update unity-game/Assets/_app/code/libs/lib-vr-base
### REMOVE
git submodule deinit -f unity-game/Assets/_app/code/libs/lib-vr-base
rm -rf .git/modules/unity-game/Assets/_app/code/libs/lib-vr-base
var fileUpload = $(".files-upload").get(0);
var files = fileUpload.files;
var data = new FormData();
for (var i = 0; i < files.length ; i++) {
data.append(files[i].name, files[i]);
}
data.append("test", "1");
$.ajax({
type: "POST",
url: "/api/v1/files/",
If there is still issue around access after creating SSH and adding it in your Bitbucket account or wherever, you need to do the below on GitBash, OSX or Linux:
ssh-add -l
Then, if you don't see your key listed, add it with:
ssh-add ~/.ssh/identity
This worked for me.
ssh-add ~/.ssh/id_rsa
@drawcode
drawcode / gist:642739b4abba5e054b285d9c8496dea5
Created January 30, 2017 07:44 — forked from prashantvc/gist:5213961
Send email with multiple attachments (Xamarin.Android)
public static void Email(Context context, string emailTo, string emailCC, string subject, string emailText, List<string> filePaths)
{
var email = new Intent(Intent.ActionSendMultiple);
email.SetType("text/plain");
email.PutExtra(Intent.ExtraEmail, new string[]{emailTo});
email.PutExtra(Intent.ExtraCc, new string[]{emailCC});
var uris = new List<IParcelable>();
filePaths.ForEach(file=> {
Code (CSharp):
// Somewhere at line 3345 in method GenerateColorToTargets()
else if(GetComponent<CanvasRenderer>())
{
colors = new Color[1,3];
colors[0,0] = colors[0,1] = GetComponent<CanvasRenderer>().GetColor();
}
Code (CSharp):