Skip to content

Instantly share code, notes, and snippets.

# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@janickr
janickr / conway.sql
Last active September 10, 2020 21:49
conway's game of life in SQL (postgresql) - http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
with recursive generation1(x,y) as ( --the initial board setup
select 2, 3
union
select 3, 3
union
select 4, 3
),
game(n, x, y) as (
select 1, x, y from generation1 -- generation 1 is initial board setup
union all
@Bombe
Bombe / GenerateVanityKey.java
Last active October 25, 2016 12:15
Use the power of threads!
/**
* GenerateVanityKey.java – generates keypairs with a prefix
* Copyright © 2014 David ‘Bombe’ Roden
* <p>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
@bertm
bertm / vanity.c
Last active November 19, 2017 20:58
Freenet vanity key generator
/*
Link to libcrypto and libgmp. Only tested on a 64 bit machine.
This program may disclose your private key, harm your computer or kill your cat. Use only if you
understand what it does. I accept no responsibility for any use of this program.
*/
#include <openssl/evp.h>
#include <gmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
@eklimcz-zz
eklimcz-zz / gist:446b56c0cb9cfe61d575
Created December 15, 2014 05:54
RSSI to Distance Conversion
function calculateDistance(rssi) {
var txPower = -59 //hard coded power value. Usually ranges between -59 to -65
if (rssi == 0) {
return -1.0;
}
var ratio = rssi*1.0/txPower;
if (ratio < 1.0) {
# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@robfallows
robfallows / client.html
Last active August 29, 2015 14:16
Simple tunguska:gauge example
<head>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=0, width=device-width">
</head>
<body>
{{> gauge id="demo" style="basic"}}
</body>
<template name="gauge">
<div id="demo" style="display:inline-block;width:200px;height:200px;"></div>
@rjerrems
rjerrems / install-node.sh
Last active November 16, 2016 01:21
Automatically install custom Node version in Elastic Beanstalk for your Meteor app
#!/bin/bash
#Lightweight script to automatically detect and install the required Node version for Meteor in Elastic Beanstalk
#This does this by parsing the MIN_NODE_VERSION from {APP}/programs/server/boot.js
#To run the script, you must supply the path to the Meteor application like this ./install-node.sh "/tmp/deployment/application/bundle"
#To see more details about the script, see the blog post here https://thesauceco.de/blog/Automatically-install-custom-Node-for-Meteor-in-Elastic-Beanstalk/
APP_DIR=$1
WORKING_DIR=/tmp/deployment
DEST_DIR=/opt/elasticbeanstalk/node-install
@rumpelsepp
rumpelsepp / install-pacaur.sh
Last active November 20, 2022 13:04
A small script for arch linux which builds and installs "pacaur" automatically
#!/usr/bin/bash -l
#
# The MIT License (MIT)
#
# Copyright (c) 2015-2017 Stefan Tatschner
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@thorsummoner
thorsummoner / multiprocessing.py
Last active November 17, 2021 18:30
python multiprocessing example
#!/usr/bin/env python3
""" Example multiprocess based python file
"""
import multiprocessing
import argparse
import itertools
ARGP = argparse.ArgumentParser(