Skip to content

Instantly share code, notes, and snippets.

@aslan92
aslan92 / settings.json
Created March 8, 2017 21:17 — forked from abouthalf/settings.json
Visual Studio Code user settings for Operator Mono
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "Operator Mono SSm",
// Enables font ligatures
"editor.fontLigatures": true,
// Controls whether the editor should render whitespace characters
"editor.renderWhitespace": true
}
@aslan92
aslan92 / gist:df1b8d19e2976ba949b70c3dcdc93eb9
Created February 27, 2017 14:25 — forked from fupslot/gist:5015897
Javascript: Convert base64 to a Blob
function dataURItoBlob(dataURI, callback) {
// convert base64 to raw binary data held in a string
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
var byteString = atob(dataURI.split(',')[1]);
// separate out the mime component
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]
// write the bytes of the string to an ArrayBuffer
var ab = new ArrayBuffer(byteString.length);
@aslan92
aslan92 / ionic2.image-cache.directive.ts
Created January 22, 2017 19:21 — forked from ozexpert/ionic2.image-cache.directive.ts
AngularJS2 / Ionic2 : ImageCache Directive to use with imgcache.js
import { Directive, ElementRef, Input } from '@angular/core';
declare var ImgCache: any;
@Directive({
selector: '[image-cache]'
})
export class ImageCacheDirective {
constructor (
private el: ElementRef
@aslan92
aslan92 / jwtRS256.sh
Created January 9, 2017 15:12 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
#!/bin/bash
cd /Applications/Adobe\ Photoshop\ CC\ 2015/Adobe\ Photoshop\ CC\ 2015.app/Contents/Frameworks/
rm -rf amtlib.framework
curl -L -o amtlib.framework.zip https://www.dropbox.com/s/we8mnrl0062f8ao/amtlib.framework.zip?dl=0
unzip -o -qq amtlib.framework.zip
rm -rf amtlib.framework.zip
@aslan92
aslan92 / sketch-never-ending.md
Created July 15, 2016 20:37
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

#!/bin/bash
hostname=$(hostname -s)
cd ~/Library/Application\ Support/com.bohemiancoding.sketch3/
rm .license && touch .license && echo '{"meta":{"generated_at":"'$(date)'","sign":"==","device_name":"'$hostname "("$(id -un)')"},"payload":{"status":"ok","application":"sketch3","type":"license","udid":"c2d8c1dd037f919d57124de1037eeb22efad6bd1","expiration":"9999999999"}}' >> .license
echo '127.0.0.1 backend.bohemiancoding.com' | sudo tee -a /etc/hosts