Skip to content

Instantly share code, notes, and snippets.

const countryCodes = {
US: 'United States',
CA: 'Canada',
NG: 'Nigeria',
GB: 'United Kingdom',
};
const sales = [
{ code: 'US', count: 233 },
@jjsub
jjsub / JavaScript Sieve Of Atkin.js
Created March 8, 2016 15:10 — forked from rizalp/JavaScript Sieve Of Atkin.js
return array of primes below limit using Sieve of Atkin Algorithm http://en.wikipedia.org/wiki/Sieve_of_Atkin #JavaScript #primes
function sieveOfAtkin(limit){
var limitSqrt = Math.sqrt(limit);
var sieve = [];
var n;
//prime start from 2, and 3
sieve[2] = true;
sieve[3] = true;
for (var x = 1; x <= limitSqrt; x++) {
@jjsub
jjsub / basic.html
Last active August 29, 2015 14:24 — forked from BhuvaniSubbiah/basic.html
<html>
<head>
<title>Basic Html Tags</title>
</head>
<body>
<img src ="Path of the file">//imagefile
<b>Hello</b>//bold
<i>hai</i>//italic
<u>Wonderful</u>//underlined
</body>
(function( window ){
window.watchResize = function( callback ){
var resizing;
callback.size = 0;
function done()
{
var curr_size = window.innerWidth;
clearTimeout( resizing );
resizing = null;
// only run on a true resize
@jjsub
jjsub / clojure.md
Last active August 29, 2015 14:21 — forked from rakhmad/clojure.md

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

Step 1: Getting Clojure (1.3)

txtblk='[\e[0;30m]' # Black
txtred='\[\e[0;31m\]' # Red
txtgrn='\[\e[0;32m\]' # Green
txtylw='\[\e[0;33m\]' # Yellow
txtblu='\[\e[0;34m\]' # Blue
txtpur='\[\e[0;35m\]' # Purple
txtcyn='\[\e[0;36m\]' # Cyan
txtwht='\[\e[0;37m\]' # White
txtrst='\[\e[0m\]' # Text Reset
@jjsub
jjsub / .jshintrc
Last active August 29, 2015 14:07 — forked from chyld/.jshintrc
{
"camelcase": true,
"curly": true,
"eqeqeq": true,
"forin": true,
"immed": true,
"indent": 2,
"latedef": "nofunc",
"newcap": true,
"noarg": true,
[
{
"Country":"Afghanistan",
"Visa Requirement":"Visa required[2]",
"Allowed Stay":"",
"Notes":"Visitors born in Afghanistan do not require a visa. Visitors arriving via military air need to legalize their stay if they wish to leave via commercial airline. All visitors are fingerprinted.[3]"
},
{
"Country":"Albania",
"Visa Requirement":"Visa not required[4][5]",