Skip to content

Instantly share code, notes, and snippets.

@bytezen
bytezen / mailmerge.py
Created November 9, 2022 13:29 — forked from Kirubaharan/mailmerge.py
This simple python Mail Merge script accepts .xlsx, .xls, and .csv files as the list input. The list input is assumed to have a header row with nickname in the first column and email in the second column. This header row will be skipped during processing. Below the header row the appropriate nickname/email combinations should be listed. The emai…
import getpass
import csv
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
import xlrd
import xlwt
import re
from time import sleep
@bytezen
bytezen / ghost_database_add_user.md
Created July 29, 2019 15:01
work around to manually add users to ghost when you can't get the darn email functionality configured.

this is from issue discussion on the ghost repository .

@mcoolidge @reustonium . depending on how critical it is (and if you have access to the database backing ghost), you can UPDATE invites SET status='sent' (there is a check that the message has been sent) and then SELECT email,token FROM invites to get the token that would have been included in the url.

Then you can insert the token into /ghost/#/signup// where token is the token from the database less the = at the end.

This has worked for me at least.

@bytezen
bytezen / song-template.rb
Created June 25, 2019 19:41
ncgs-workshop template
##| ncgs2019-song-template.rb
##| Song template
##| -----------------------------------------
##| DRUMS
##| -----------------------------------------
comment do
use_bpm #tempo
@bytezen
bytezen / part2-ncgs-bass.rb
Created June 25, 2019 16:57
ncgs part 2 making a bass line
##| part2-ncgs-bass.rb
##| The bass will set the rhythm and get
##| folks nodding their heads
##| make sure your tempo is the same as
##| whatever you chose for your drums
use_bpm 60
@bytezen
bytezen / part1-ncgs-drums.rb
Created June 25, 2019 16:56
ncgs part1 making a drum pattern
##| part1-ncgs-drums.rb
##| Let's set the energy of the tune by designing a drum pattern
##| choose a tempo for your song
##| the default tempo is 60 beats per minute
use_bpm 60
##| 1) Kick
##| Choose a sound for your kick drum
@bytezen
bytezen / g-funk.rb
Created June 25, 2019 16:51
ncgs workshop demo
##| National Coalition of Girls Schools
##| Conference 2019
##|
##| Hands-On Workshop
##| "From Bleep, Blip, Boop to Variables, Arrays, and Loops: Teaching with Sonic Pi"
##|
##| g(irl)-funk
##| by: bytezen
use_bpm 114
@bytezen
bytezen / blur.js
Created November 19, 2018 22:04
Blur in p5js
var layer, layer2;
function setup() {
createCanvas(400, 400);
// background(200);
//Layers = Graphics
// the circle on the top
layer = createGraphics(100,100);
layer.background(255,0);
@bytezen
bytezen / whysicpmatters.md
Created August 23, 2018 01:14 — forked from jonvuri/whysicpmatters.md
Brian Harvey: Why SICP Matters

[Original]

Why Structure and Interpretation of Computer Programs matters

Brian Harvey University of California, Berkeley

In 2011, to celebrate the 150th anniversary of MIT, the Boston Globe made a list of the most important innovations developed there. They asked me to explain the importance of SICP, and this is what I sent them:

@bytezen
bytezen / calculate_wall_avoidance.py
Created July 26, 2018 20:19
function for a boid to calculate a force to avoid walls in the world
def calculate_wall_avoidance(self, walls):
self.whiskers = util._create_whiskers(self.pos, self.heading)
#variables for keep track of tallys
distance_to_intersection_point = 0
distance_to_closest_intersection_point = sys.float_info.max
closest_wall = None
@bytezen
bytezen / util.py
Created July 25, 2018 20:12
utility functions for geometry functions, behavior support for AI Programming Summer Workshop
import pygame as pg
from pygame.math import Vector2
def _rotate(surface, angle, pivot, offset):
"""Rotate the surface around the pivot point
Args:
surface (pygame.Surface): The surface that is to be rotated
angle (float): Rotate by this angle