Skip to content

Instantly share code, notes, and snippets.

Avatar

samy kamkar samyk

View GitHub Profile
@samyk
samyk / graph.html
Created Nov 17, 2022 — forked from kevinfjbecker/graph.html
HTML5 Canvas Line Graph
View graph.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Roulette</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
article, aside, figure, footer, header, hgroup,
@samyk
samyk / mks_901p.py
Created Dec 29, 2019 — forked from nmz787/mks_901p.py
work in progress MKS 901P vacuum transducer sensor library and command-line program.
View mks_901p.py
"""
usage: mks_901p.py [-h] [--find_baud] [--baud BAUD] [-unit] serial_port
positional arguments:
serial_port the Windows COM port or path to a linux serial port
optional arguments:
-h, --help show this help message and exit
--find_baud tries to access the sensor over all supported baud rates,
prints which is successful
@samyk
samyk / syphon2serial.pde
Created Jun 29, 2019
Syphon to Serial Processing 2 app
View syphon2serial.pde
/*
* syphon2serial (syphon -> teensy using octows2811)
* take video input from Syphon (eg Resolume Arena) out to Teensys over serial
* by Samy Kamkar - http://samy.pl - code@samy.pl
*
* based off of OctoWS2811 movie2serial
*/
/* OctoWS2811 movie2serial.pde - Transmit video data to 1 or more
Teensy 3.0 boards running OctoWS2811 VideoDisplay.ino
@samyk
samyk / sctag
Created Nov 23, 2018
Convert Supercell gamer tags / avatar IDs / account IDs between each other
View sctag
#!/usr/bin/perl
#
# Convert Supercell gamer tags to avatar/account IDs and vice versa
# Tested on Crash Royale and Boom Beach
# - supports new Boom Beach avatar_id format
#
# -samy kamkar - https://samy.pl
# 2018/11/23
my @tagchrs = qw/0 2 8 9 P Y L Q G R J C U V/;
@samyk
samyk / sin134-pdb-dma-dac.c
Last active Sep 8, 2020
134kHz sine wave w/DMA, DAC and PDB on Teensy 3.6
View sin134-pdb-dma-dac.c
// Generating a 134kHz sine wave using Teensy 3.6 with virtually
// 0 cpu usage by filling the DAC up via DMA triggered by PDB
// -samy kamkar
#include <DMAChannel.h>
#include "pdb.h"
DMAChannel dma(false);
static volatile uint16_t sinetable[] = {
@samyk
samyk / package-vers.pl
Created Dec 30, 2016
print version numbers for all perl packages
View package-vers.pl
# add to top of perl program to print version numbers for perl packages
use Data::Dumper;
print "$_\n" for grep { /:: \d/ } map { "$_ " . eval "\$${_}VERSION" } grep { /::$/ } keys %{"main::"};
@samyk
samyk / sin134.c
Last active Aug 21, 2019
134kHz sine wave on Teensy 3.6
View sin134.c
// We can send 223 analog values (per wavelength) with an unrolled loop to get ~134kHz sine wave on 180MHz Teensy 3.6
//
// A version that uses virtually no CPU by controlling the DAC via DMA and PDB is here:
// https://gist.github.com/samyk/6273cf9a45d63a50c38c8b50a39a8f52
//
// -samy kamkar
// If you want to use a for loop, you can only send 161vals per wavelength
/*
#define SINE 161
@samyk
samyk / chrome_tabs.osa
Created Jun 14, 2016
applescript to show all url+titles of Chrome tabs along with front window+tab url+title
View chrome_tabs.osa
# shows all url+titles of Chrome along with front window+tab url+title
set titleString to ""
tell application "Google Chrome"
set window_list to every window # get the windows
repeat with the_window in window_list # for every window
set tab_list to every tab in the_window # get the tabs
repeat with the_tab in tab_list # for every tab
View gsg-case-bottom.stl
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View keybase.md

Keybase proof

I hereby claim:

  • I am samyk on github.
  • I am samy (https://keybase.io/samy) on keybase.
  • I have a public key whose fingerprint is 8EFB B6A5 6900 7401 B68F 9038 F4E1 C226 C2F6 EA94

To claim this, I am signing this object: