Skip to content

Instantly share code, notes, and snippets.

@jayzalowitz
jayzalowitz / fs-mob.cft.yml
Last active April 5, 2021 06:53
Full service boot attempt
AWSTemplateFormatVersion: '2010-09-09'
Metadata:
License: Apache-2.0
Description: 'AWS CloudFormation template for the creation and storing of a mobilecoin wallet.'
Parameters:
InstanceType:
Description: EC2 instance type
Type: String
Default: m5a.xlarge
AllowedValues: [t2.nano,t2.small,t3.nano,t3a.nano,m5a.xlarge,m5a.large]
@jayzalowitz
jayzalowitz / delete_bad_topics.py
Last active June 22, 2020 02:08
Deleting unused aws sns topics
# you will need to set your keys and your region name in your ~/.aws/config for this to work
import boto3
session = boto3.session.Session(region_name='us-east-1') # make sure this is the region you are using
sns = session.resource('sns')
client = boto3.client('sns')
topics = {}
dead_subs = []
@jayzalowitz
jayzalowitz / Minesweep.rb
Created March 1, 2016 22:53
A ruby based minesweeper command line game
def minesweeper(size,mines)
@gamestate = "Ongoing"
@size = size
@number_of_squares = size * size
@mines = mines
@mine_grid = []
@count = 0
@clicks = []
@clicks.push()
@size.times do
<a title="Generate Great Referrals" href="http://blog.referralfeed.com" target="_blank"><img alt="Florida State Vs Auburn" src="https://s3.amazonaws.com/referralfeed-blog/2014/01/auburnvsfloridastatealmuni.png" width="720" height="2160" /></a>
@jayzalowitz
jayzalowitz / gist:6922139
Created October 10, 2013 17:19
random().php
function random() { return ceil(pi());/*chosen by dice roll, guaranteed to be random*/ }
@jayzalowitz
jayzalowitz / gist:6910569
Last active December 25, 2015 03:29
Quite possibly my only real contribution to the world's happiness...
function humpday(){
if ((!$_COOKIE['cameled']) && (strftime("%A",time()) == "Wednesday")){
return '
<script type="text/javascript">
var date = new Date();
date.setTime(date.getTime() + (600000));
var expires = "; expires=" + date.toGMTString();
document.cookie = "cameled=yes" + expires + "; path=/";
</script>
<iframe width="560" height="315" src="//www.youtube.com/embed/Vs5QJi-dX-4?autoplay=1" frameborder="0" allowfullscreen></iframe>';
@jayzalowitz
jayzalowitz / bs.php
Created January 27, 2013 00:06
The solution to "Beautiful Strings" on facebook's hackers cup in php https://www.facebook.com/hackercup/problems.php?pid=475986555798659&round=185564241586420
<?php
$case = 0;
$filename = "beautiful_stringstxt";
$facebook = file($filename, FILE_IGNORE_NEW_LINES);
foreach($facebook as $line)
{
$linebeauty = 0;
if (!($case == 0)){
$stack = array();