Skip to content

Instantly share code, notes, and snippets.

View NixImagery's full-sized avatar

Nick Hood NixImagery

View GitHub Profile
@NixImagery
NixImagery / gist:e63ada677aadd6495e2a312171169809
Last active October 14, 2016 09:52
Verifying that +cullaloe is my blockchain ID. https://onename.com/cullaloe
Verifying that +cullaloe is my blockchain ID. https://onename.com/cullaloe
@NixImagery
NixImagery / gist:82bb7b0d5bca363ead17778e447581f6
Last active October 16, 2016 16:43
Verifying that "cullaloe.id" is my Blockstack ID. https://onename.com/cullaloe
Verifying that "cullaloe.id" is my Blockstack ID. https://onename.com/cullaloe
@NixImagery
NixImagery / gist:1df4b4b0f57daf2c693facfc7ded1bec
Created October 14, 2016 14:15
Crontab for a twitterbot
0,5,10,15,20,25,30,35,40,45,50,55 * * * * cd /var/www/vhosts/cullaloe.hostinguk.org/sptr && php -q /var/www/vhosts/cullaloe.hostinguk.org/sptr/tweet.php >/dev/null
Flash cookies are stored in:
~/Library/Preferences/Macromedia/Flash Player/#SharedObjects
~/Library/Preferences/Macromedia/Flash Player/macromedia.com/support/flashplayer/sys/
~/Library/Application Support/Google/Chrome/Default/Pepper Data/Shockwave Flash/WritableRoot/#SharedObjects/
Adobe Air cookies are stored in:
~/Library/Preferences/AIR App Name/Local Store/#SharedObjects/flash file.swf/flash object.sol
@NixImagery
NixImagery / gist:b0342a79e465ba0beaa0321b27372161
Created October 18, 2016 06:58
Verifying that "cullaloe.id" is my Blockstack ID. https://onename.com/cullaloe
Verifying that "cullaloe.id" is my Blockstack ID. https://onename.com/cullaloe
@NixImagery
NixImagery / 0_reuse_code.js
Created April 26, 2017 13:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
int main(){
int t;
cin >> t;
vector<long> p;
for (int a=100001; a < 900010; a+=100001)
for (int b = 0; b < 90091; b+=10010)
for (int c = 0; c < 9901; c+=1100)
p.push_back(a + b + c);
sort(p.begin(), p.end());
p.push_back (0);
using namespace std;
int main(){
vector<int> pn{1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199};
vector<int> pn2{pn};
int t;
cin >> t;
for(int a0 = 0; a0 < t; a0++){
int n;
using namespace std;
int main(){
int t;
cin >> t;
for(int a0 = 0; a0 < t; a0++){
int n;
int b, c;
long abc;
using namespace std;
int main(){
int t;
cin >> t;
// Using sieve of Eratosthenes, from Wikipedia
bool primes[1000001]; // Let A be an array of Boolean values,
fill_n(primes, 1000001, true); // indexed by integers 2 to n, initially all set to true.
for (long i = 2; i <= 1000; ++i) // i = 2, 3, 4, ..., not exceeding root n:
if (primes[i]) // if A[i] is true: