Skip to content

Instantly share code, notes, and snippets.

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++) {
@kramtark
kramtark / chromesearchmultvar.js
Created October 29, 2019 22:31 — forked from cmccormack/chromesearchmultvar.js
Google Chrome Search Engine with multiple search strings
/**
* @desc this snippet will allow multiple arguments to a search query in Google Chrome
* examples include https://www.reddit.com/r/%s/search?q=%s
* @author Chris McCormack mccormack.christopher@gmail.com
* @required Google Chrome. Replace all values in brackets ([]) with valid entries.
* To add to Chrome, go to Settings > Search [Manage search engines...] > Other search engines.
* At the bottom of this section, there are three required fields:
* [Add a new search engine] [Keyword] [URL with %s in place of query]
* - Add a new search engine: Descriptive name of your search
* - Keyword: used to trigger search.
@kramtark
kramtark / url_to_drive.js
Created January 27, 2020 23:27 — forked from honktang/url_to_drive.js
Google Apps Script to upload a file from an URL directly to Google Drive.
// url_to_drive.gs
// Google Apps Script
// Allows uploading a URL directly to Google Drive.
//
// Live link:
// https://script.google.com/macros/s/AKfycbzvhbHS4hnWPVBDHjQzZHA0qWq0GR-6hY7TbYsNto6hZ0MeAFZt/exec
//
// Source-code:
// https://gist.github.com/denilsonsa/8134679
// https://script.google.com/d/1Ye-OEn1bDPcmeKSe4gb0YSK83RPMc4sZJt79SRt-GRY653gm2qVUptoE/edit