Skip to content

Instantly share code, notes, and snippets.

View LiuuY's full-sized avatar
💭
👨‍🚀☕️

LiuuY

💭
👨‍🚀☕️
View GitHub Profile
@LiuuY
LiuuY / Package Control.sublime-settings
Last active October 28, 2016 07:57
Sublime Text packages for React.js develop
{
"installed_packages":
[
"Babel",
"EditorConfig",
"Emmet",
"Git",
"HTML-CSS-JS Prettify",
"Oceanic Next Color Scheme",
"Package Control",
@LiuuY
LiuuY / getPrimes.js
Created July 22, 2016 06:56
A sieve implementation in JavaScript
// http://stackoverflow.com/a/12287599
function getPrimes(max) {
var sieve = [], i, j, primes = [];
for (i = 2; i <= max; ++i) {
if (!sieve[i]) {
// i has not been marked -- it is prime
primes.push(i);
for (j = i << 1; j <= max; j += i) {
sieve[j] = true;
}
// input string
var originString = [
"st->io",
"io->cond",
"cond(yes)->op1",
"cond(no)->op2",
"op1->sop1",
"op2->sop2",
"sop1->io1",
"sop2->io2",