Skip to content

Instantly share code, notes, and snippets.

@janily
janily / randomDomainNameGenerator.js
Created October 14, 2020 05:44 — forked from pedrouid/randomDomainNameGenerator.js
Random Domain Name Generator
// @desc Creates a list of domains with custom TLDs using a pattern string with fixed length with option for keywords
// @param {String} pattern
// @param {Array|String} tlds
// @returns {Array} domainList
//
//
// Pattern string is defined by:
// - keywords lowercase
// - any letter uppercase A
// - consonants uppercase C
A list of sketch scripts
const tokenArray = [
{ name: 'color-background-default', value: '#f5f7fa'},
{ name: 'color-background-white', value: '#fff'},
{ name: 'color-background-dark', value: '#202d40'},
{ name: 'color-background-tooltip', value: '#202d40'},
{ name: 'color-background-message-warning', value: '#fffbe5'},
{ name: 'color-background-message-success', value: '#f2ffe0'},
{ name: 'color-background-message-error', value: '#fff0f0'},
{ name: 'color-background-message-info', value: '#e6f7ff'},
{ name: 'color-background-list-row-hover', value: '#f5f7fa'},
@janily
janily / 0 Generate icons collection.sketchscript
Created June 14, 2020 03:45 — forked from tankxu/0 Generate icons collection.sketchscript
Use this script to genrate icons collection artboard for your icon sketch library.
const sketch = require("sketch")
const document = sketch.getSelectedDocument()
const selection = document.selectedLayers.layers
const Group = sketch.Group
const Style = sketch.Style
const Rectangle = sketch.Rectangle
const Artboard = sketch.Artboard
const ShapePath = sketch.ShapePath
const Text = sketch.Text
const SymbolInstance = sketch.SymbolInstance
@janily
janily / README.md
Created May 30, 2020 14:22 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@janily
janily / index.html
Created May 22, 2020 02:09 — forked from astojilj/index.html
TensorFlow.js CNN Background Removal
<html>
<head>
<body onload="onLoad()">
<div id="container">
<div id="show-background">Show background as magenta<input id="show-background-toggle" type="checkbox" checked></div>
<canvas id="canvas" width=640px height=480px></canvas>
</div>
</body>
</head>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]"> </script>
@janily
janily / colorpick.js
Created March 22, 2020 14:25 — forked from KevinGutowski/colorpick.js
Color Picker Sketch [WIP]
let dialog = NSAlert.alloc().init()
let view = NSView.alloc().initWithFrame(NSMakeRect(0,0,100,100))
let button = MSColorWell.alloc().initWithFrame(NSMakeRect(0,0,50,50))
button.initialColor = NSColor.redColor()
button.target = button
button.canDisplayPopover = true
button.setAction("presentColorPicker:")
view.addSubview(button)
dialog.accessoryView = view
@janily
janily / gist:fac045b5725f579e5f05294a282ca5be
Created September 22, 2016 06:51 — forked from libo1106/gist:9777985
flex未知高度垂直居中写法
<!DOCTYPE html>
<html lang="zh-CN" class="fullscreen">
<head>
<title>flex未知高度垂直居中写法</title>
<style>
html,body{
width: 100%;
height: 100%;
overflow: hidden;
@janily
janily / express-2-to-4-x.txt
Created April 9, 2016 11:48 — forked from 1Marc/express-2-to-4-x.txt
Express 2 to Express 4.x
Express 2 was used in the course and the current version is 4.x.
you can't just use 'urlencoded' anymore, you have to:
npm install body-parser
and
var bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: true }));