Skip to content

Instantly share code, notes, and snippets.

View taesiri's full-sized avatar
😎
Keep Hacking!

Mohammad Reza Taesiri taesiri

😎
Keep Hacking!
View GitHub Profile
@cwood1967
cwood1967 / display.py
Last active August 19, 2022 15:55
Use bokeh to hover over scatter plot and display thumbnail
import pandas as pd
import autoencoder.hover as hover
from bokeh.plotting import figure, ColumnDataSource
from bokeh.models import HoverTool, ZoomInTool, ZoomOutTool
from bokeh.io import output_notebook, show
from bokeh.palettes import Spectral6, inferno
## this uses the pandas dataframe df that is already full of data
df['agc'] =agc ## this put results from clustering into the dataframe
output_notebook()
@mcdickenson
mcdickenson / get_replies.py
Created March 2, 2019 14:59
Extract replies to a tweet into a CSV
import csv
import tweepy
# get credentials at developer.twitter.com
auth = tweepy.OAuthHandler('API Key', 'API Secret')
auth.set_access_token('Access Token', 'Access Token Secret')
api = tweepy.API(auth)
# update these for whatever tweet you want to process replies to
@itdaniher
itdaniher / common_and_latin_name.json
Last active March 29, 2023 20:50
common_and_latin_name.json
{
"7 Pot Brain Strain Red Pepper": "Capsicum chinense",
"7 Pot Bubble Gum Pepper": "Capsicum chinense",
"7 Pot Pepper Barrackpore": "Capsicum chinense",
"7 Pot Pepper Brain Strain Yellow": "Capsicum chinense",
"7 Pot Pepper Orange": "Capsicum chinense",
"7 Pot Pepper Yellow": "Capsicum chinense",
"7 Pot Pink Pepper": "Capsicum chinense",
"7 Pot Rust Pepper": "Capsicum chinense",
"Abe Lincoln Tomato": "Solanum lycopersicum",
@kylemcdonald
kylemcdonald / biggan-search.ipynb
Last active December 16, 2018 03:34
BigGAN Search
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@batpigandme
batpigandme / data_mask_tidy_eval.Rmd
Created November 15, 2018 22:59
Playing w/ data mask example from tidy eval cheatsheet
---
title: "Data mask stuff"
output: github_document
---
```{r include=FALSE, message=FALSE, warning=FALSE}
knitr::opts_chunk$set(
message = FALSE, warning = FALSE, echo = TRUE, fig.retina = 2, collapse = TRUE
)
```
@DavidBuchanan314
DavidBuchanan314 / cursed_mandelbrot.c
Last active June 28, 2023 15:12
Compile-time mandelbrot in pure C. Outputs a PGM image file to stdout. Output can be seen at https://twitter.com/David3141593/status/1062468528115200001
#include <stdio.h>
#define SQ(x) (x)*(x)
#define M0(x,y) SQ(x)+SQ(y)<4?0:0xe0
#define M1(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M0(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0)):0xc0
#define M2(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M1(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0xa0
#define M3(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M2(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x80
#define M4(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M3(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x60
#define M5(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M4(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x40
@swyxio
swyxio / .gitignore_global
Last active December 29, 2024 12:07
my dotfiles - more info here https://www.swyx.io/new-mac-setup
.DS_Store
._.DS_Store
**/.DS_Store
**/._.DS_Store
.vscode
.idea
Thumbs.db
# used to need to run git config --global core.excludesfile ~/.gitignore_global to set this but apparently no longer needed https://x.com/bate5a55/status/1840594630972191118
@mattdesl
mattdesl / sol-lewitt-wall-drawing-273.js
Created October 17, 2018 12:40
Sol LeWitt "Wall Drawing 273" (7th wall) recreated in JavaScript
const canvasSketch = require('canvas-sketch');
const random = require('canvas-sketch-util/random');
const { lerp, lerpArray } = require('canvas-sketch-util/math');
const palettes = require('nice-color-palettes');
const settings = {
dimensions: 'A4',
orientation: 'landscape',
units: 'cm',
pixelsPerInch: 300