Skip to content

Instantly share code, notes, and snippets.

@sbauch
sbauch / gist:7874478
Last active December 30, 2015 19:29
js launch sequence
console.log('Starting Launch Sequence...');
(function launchSequence (i) {
setTimeout(function () {
console.log(i);
if (--i){
launchSequence(i);
}
else {
setTimeout(console.log('BLAST OFF!'), 1000);
}
@sbauch
sbauch / echo.rb
Created July 6, 2014 17:22
echonest data block
[{:action=>"update", :item=>{:track_id=>"4RL77hMWUq35NYnPLXBpih"}},
{:action=>"update", :item=>{:track_id=>"2kOTgiY7BlXF7wKo65mL7a"}},
{:action=>"update", :item=>{:track_id=>"5crHvEPQ13FbQGQSscm5Ns"}},
{:action=>"update", :item=>{:track_id=>"3rhnT5RoN7bvPUpMHt1aM9"}},
{:action=>"skip", :item=>{:track_id=>"7F06kkQg868sTJRoUWq1d6"}}]
@sbauch
sbauch / gist:0f5ebdf71393505fe6f5
Created July 8, 2014 13:54
Echonest & Spotfiy: Taste Profile Create => Update => Playlist => Spotify Web API Lookup
HTTParty.post('http://developer.echonest.com/api/v4/tasteprofile/create',
:body => {:api_key => '#############',
:type => 'general',
:name => 'tester testy'
}
)
=> {"response"=>{"status"=>{"version"=>"4.2", "code"=>0, "message"=>"Success"}, "type"=>"general", "name"=>"tester testy", "id"=>"CAIGHXV147163258A7"}}
class MessagingController < JSQMessagesViewController
alias :'super_collectionView:cellForItemAtIndexPath' :'collectionView:cellForItemAtIndexPath'
attr_accessor :messages, :incomingBubbleImageData, :outgoingBubbleImageData, :garyAvatar
JSQ_MESSAGES_COLLECTION_VIEW_CELL_LABEL_HEIGHT = 20.0
def viewDidLoad
super
@sbauch
sbauch / get_audience.rb
Created January 12, 2015 17:20
Twitter List => Custom Audience
require 'twitter'
require 'csv'
handle = ARGV[0]
list = ARGV[1]
client = Twitter::REST::Client.new do |config|
config.consumer_key = "YOUR KEY"
config.consumer_secret = "YOUR SECRET"
{
"timings": [
{
"Flash": 2,
"round": 0,
"time": 0,
"Playing": false,
"Watching": false,
"Countdown": 4
},
@sbauch
sbauch / pinAssets.ts
Created August 7, 2021 00:59
NFT.storage loop
import * as fs from 'fs';
import * as path from 'path';
import 'dotenv/config';
import { NFTStorage, File } from "nft.storage";
async function main() {
const storage = new NFTStorage({ token: process.env.NFT_STORAGE_KEY });
const directory = [];
@sbauch
sbauch / filters.xml
Last active September 1, 2021 15:36
Apply a filter to OpenSea emails to skip inbox
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
<title>Mail Filters</title>
<id>tag:mail.google.com,2008:filters:z0000001630333632397*6447181831119360404</id>
<updated>2021-08-30T23:44:15Z</updated>
<author>
<name>Sam Bauch</name>
<email>[email protected]</email>
</author>
<entry>
@sbauch
sbauch / pickWinner.ts
Created September 2, 2021 14:56
Script for picking Wrassler giveaway winner
import 'dotenv/config';
import {ethers} from 'hardhat';
import RandomOrg from 'random-org';
import {
abi as arenaAbi,
address as arenaAddress,
} from '../deployments/matic/WrasslingArenaV2.json';
import {
import classnames from 'classnames';
import { Web3Context } from 'contexts/web3Context';
import CSS from 'csstype';
import React, { ReactElement, useContext } from 'react';
import styles from './styles.module.css';
const chainArgs = {
'137': {
chainId: '0x89',