Skip to content

Instantly share code, notes, and snippets.

@elyase
elyase / run in warp.popcliptxt
Last active September 8, 2024 09:51
Run command in Warp with pop clip
-- # PopClip Run in Warp
-- { name: Run in Warp, icon: iconify:simple-icons:warp, language: applescript }
tell application "Warp"
activate
tell application "System Events"
tell process "Warp"
delay 0.01
set sourceText to "{popclip text}"
keystroke sourceText
delay 0.01
@elyase
elyase / ibsimu_install.md
Created November 26, 2021 17:45
ibsimu install ubuntu

Tested on ubuntu 20.04.3

Install dependencies

sudo apt-get install build-essential
sudo apt install libcairo2-dev
sudo apt install libgsl-dev
sudo apt install libgtk-3-dev

Download the code

@elyase
elyase / install_debian.md
Last active November 26, 2021 17:52
ibsimu installation debian/ubuntu

Tested on debian buster

Install dependencies

sudo apt install libcairo2-dev
sudo apt install libgsl-dev
sudo apt install libgtk-3-dev

Download the code

@elyase
elyase / convert_mysql_to_sqlite3.sh
Created December 15, 2017 17:04 — forked from grfiv/convert_mysql_to_sqlite3.sh
convert a mysql database to sqlite3
#!/bin/bash
#
# convert a mysql database to sqlite3
#
#see https://stackoverflow.com/questions/5164033/
# export-a-mysql-database-to-sqlite-database
mysql_host=localhost
mysql_user=george
#mysql_passwd=****************
@elyase
elyase / preprocess-twitter.py
Created April 29, 2016 08:26 — forked from tokestermw/preprocess-twitter.py
Python version of Ruby script to preprocess tweets for use in GloVe featurization http://nlp.stanford.edu/projects/glove/
"""
preprocess-twitter.py
python preprocess-twitter.py "Some random text with #hashtags, @mentions and http://t.co/kdjfkdjf (links). :)"
Script for preprocessing tweets by Romain Paulus
with small modifications by Jeffrey Pennington
with translation to Python by Motoki Wu
Translation of Ruby script to create features for GloVe vectors for Twitter data.
@elyase
elyase / recursive_delete.py
Created November 16, 2015 02:10
Recursively deleting a folder in Dropbox to overcome the 10000 files limitation.
# Include the Dropbox SDK
import dropbox
# Get your app key and secret from the Dropbox developer website
# https://www.dropbox.com/developers-v1/apps
app_key = 'key'
app_secret = 'secret'
flow = dropbox.client.DropboxOAuth2FlowNoRedirect(app_key, app_secret)
@elyase
elyase / install.md
Last active August 15, 2020 11:37
ibsimu installation on osx

Tested on ibsimu-1.0.6dev, OSX Yosemite, High Sierra, Catalina.

Install homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install dependencies

brew install autoconf automake libtool gtk+3 gsl

@elyase
elyase / curvature.py
Last active June 2, 2023 11:35
2D curve curvature
from scipy.interpolate import UnivariateSpline
import numpy as np
def curvature_splines(x, y=None, error=0.1):
"""Calculate the signed curvature of a 2D curve at each point
using interpolating splines.
Parameters
----------
x,y: numpy.array(dtype=float) shape (n_points, )
function (x, y = NULL, xtest = NULL, ytest = NULL, ntree = 500,
mtry = if (!is.null(y) && !is.factor(y)) max(floor(ncol(x)/3),
1) else floor(sqrt(ncol(x))), replace = TRUE, classwt = NULL,
cutoff, strata, sampsize = if (replace) nrow(x) else ceiling(0.632 *
nrow(x)), nodesize = if (!is.null(y) && !is.factor(y)) 5 else 1,
maxnodes = NULL, importance = FALSE, localImp = FALSE, nPerm = 1,
proximity, oob.prox = proximity, norm.votes = TRUE, do.trace = FALSE,
keep.forest = !is.null(y) && is.null(xtest), corr.bias = FALSE,
keep.inbag = FALSE, ...)
{
@elyase
elyase / SparkSQL
Created November 20, 2014 23:50
Data Exploration Using Spark SQL
{
"metadata": {
"name": "",
"signature": "sha256:f04c113accbabf25e09e5680267acfb16af33ae3a79b0992a8aea30875c51b17"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [