Skip to content

Instantly share code, notes, and snippets.

@benstr
benstr / genericEmailDomains.js
Created February 28, 2019 18:51
List of generic free email providers
var domains = [
/* Default domains included */
"aol.com", "att.net", "comcast.net", "facebook.com", "gmail.com", "gmx.com", "googlemail.com",
"google.com", "hotmail.com", "hotmail.co.uk", "mac.com", "me.com", "mail.com", "msn.com",
"live.com", "sbcglobal.net", "verizon.net", "yahoo.com", "yahoo.co.uk",
/* Other global domains */
"email.com", "fastmail.fm", "games.com" /* AOL */, "gmx.net", "hush.com", "hushmail.com", "icloud.com",
"iname.com", "inbox.com", "lavabit.com", "love.com" /* AOL */, "outlook.com", "pobox.com", "protonmail.com",
"rocketmail.com" /* Yahoo */, "safe-mail.net", "wow.com" /* AOL */, "ygm.com" /* AOL */,
@benstr
benstr / mkrnb_holo_jumper.ino
Created January 29, 2019 05:08
NB MKR1500 example [ugly]
/*
Hologram Demo - GSM Network Jumping
This example shows how to switch between carriers using a Hologram SIM.
Circuit:
* MKR NB 1500 board
* Antenna
* Hologram SIM card
Created 12 Dec 2018
by Benstr
*/
@benstr
benstr / Tower_Jumping_Log.js
Last active December 12, 2018 11:55
Log showing controlled carrier jumping (AT&T-3G>>TMO-3G>>TMO-2G>>TMO-3G) with Hologram.io SIM
{
success: true,
limit: 100,
size: 5,
continues: false,
lastid: 430796983,
data: [
{
linkid: 387074,
record_id: 430817875,
@benstr
benstr / b64-cellular.py
Created January 9, 2018 16:53
Example using base64 encoding to send a image over cellular on a Raspberry Pi with Hologram.io
from Hologram.HologramCloud import HologramCloud
import logging
import base64
#uncomment if you want to see debugging messages.
#not suggested for larger images
#logging.basicConfig(level=logging.DEBUG, format="%(levelname)s: %(message)s")
hologram = HologramCloud(dict(), authentication_type='totp', network='cellular')
#include <SoftwareSerial.h>
int _MODEMSTATE = 1; // set state as available
int RESET_PIN = 10 //SIM800 reset connected to pin D10
int TX_PIN = 7;
int RX_PIN = 8;
String _MESSAGEBUFFER = "";
String _SERIALBUFFER = "";
SoftwareSerial serialHologram(TX_PIN, RX_PIN);
@benstr
benstr / seeed-v2-hologram-sketch.cpp
Created October 5, 2017 09:16
Sketch for using raw AT commands on a Seed Studio GPRS Shield with a Hologram.io SIM
/*
Note: this code is a demo for how to use a gprs shield to send
an http request to a test website (using the Hologram APN).
To communicate with the Arduino via terminal, set
the outgoing baud rate to 19200, and set line endings to
carriage return.
Then, in order to initiate the demo http request, enter
'h' into the terminal at the top of the serial monitor.
@benstr
benstr / clone-all-twitter-github-repos.sh
Created October 18, 2016 16:37 — forked from caniszczyk/clone-all-twitter-github-repos.sh
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@benstr
benstr / summernote-imageupload.js
Last active April 5, 2016 10:56
summernote & okgrow:image-upload example
Template.blogList.onRendered( function () {
var self = this;
$('#summernote').summernote({
height: 400,
maxHeight: 800,
minHeight: 250,
onImageUpload: function (files, editor, $editable) {
var file = files[0];
var coll = ImageUpload.getImageCollection('imageUploadCollectionName');
if (file) {
@benstr
benstr / accountsValidate.js
Last active September 3, 2015 14:04 — forked from ctaloi/accountsValidate.js
Validate a new Meteor account based on email suffix
function checkEmailAddress(emailAddress) {
check(emailAddress, String);
suffix = emailAddress.split('@')[1];
if (suffix === "wcs.com")
{ return true } else { return false };
};
Accounts.validateNewUser(function (user) {
console.log(user);
if (checkEmailAddress(user.emails[0].address)) {
@benstr
benstr / id-schema.js
Created June 17, 2015 20:42
id schema
ownerId: {
type: String,
regEx: /^[a-z0-9A-z .]{3,30}$/,
optional: true
},
vetId: {
type: String,
regEx: /^[a-z0-9A-z .]{3,30}$/,
optional: true
},