Skip to content

Instantly share code, notes, and snippets.

View leoneckert's full-sized avatar
🕳️

Leon Eckert leoneckert

🕳️
View GitHub Profile
@leoneckert
leoneckert / index.html
Last active March 31, 2018 21:29
pured3 speed test vs vue+d3 (fyi drag nodes and scroll in viz 2 zoom)
<html>
<head>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.5/lodash.min.js"></script>
<style>
body{ width: 100%; height: 100%; margin:0}
svg{ width: 100%; height: 100%;}
</style>
</head>
<body>
import os
import time
from InstagramAPI import InstagramAPI
# repo: https://github.com/LevPasha/Instagram-API-python
api = InstagramAPI("username", "password")
usedAlready = []
def checkFolder(directory):
print "Checking", directory
@leoneckert
leoneckert / dodo.js
Created March 5, 2018 03:02
little thing to scroll down a page (made for ziyu)
//https://stackoverflow.com/a/4770179
//
//https://stackoverflow.com/a/20670662
//
var EPPZScrollTo =
{
/**
* Helpers.
*/
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
function chess(n){
for(let i = 0; i<n; i++){
let line = "";
for(let j = 0; j<n; j++)
line += i%2==(j%2?0:1)?"#":" "; //iterate what to assign, but iterate the order of that iteration, too :)
console.log(line);
}
}
@leoneckert
leoneckert / README.md
Created February 7, 2018 03:16
force circles in a box

I wanted to understand forces.... I sort of do know (though initially I wanted to do a nice gravity simulation and didnt manage to do it - do it beautifully that is, without collision overlap etc...). I ended up making this with some obvious inspiration and code snippets and help fro links below. ✌️

simple study of forces based on https://bl.ocks.org/mbostock/6526445e2b44303eebf21da3b6627320 https://github.com/d3/d3-force#collision https://stackoverflow.com/questions/42790193/how-to-set-the-gravity-strength-in-d3v4-force-simulation https://bl.ocks.org/mbostock/31ce330646fa8bcb7289ff3b97aab3f5 http://mbostock.github.io/d3/talk/20111018/collision.html https://stackoverflow.com/questions/44055869/converting-collision-detection-example-to-from-v3-to-v4-d3

@leoneckert
leoneckert / index.html
Last active January 28, 2018 23:21
rainbow blocks
<html>
<head>
<script src="perlin.js"></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<style>
body{
width:100%
height:100%;
margin:0;
@leoneckert
leoneckert / index.html
Last active January 27, 2018 23:11
block to circles
<html>
<head>
<script src="perlin.js"></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<style>
body{
width:100%
height:100%;
margin:0;
@leoneckert
leoneckert / data.csv
Last active November 4, 2017 05:53
data binding practise
city name count
Buenos Aires Anna 25
Paris Anna 12
Berlin Anna 70
New York Anna 320
Lima Anna 65
Paris Bob 18
Berlin Bob 5
Moscow Bob 28
New York Bob 120
@leoneckert
leoneckert / localP5Editor_bash_aliases.sh
Last active October 30, 2017 22:05
4 commands for a cool local p5 experience. Requires live-server (npm install -g live-server) and a dir structure with 'masterCopyP5' in place.
function p5newproject {
cd ~/Documents/p5LocalEditor/projects/ && mkdir "$1" && cd "$1" && cp ~/Documents/p5LocalEditor/masterCopyP5/* . && atom . && live-server;
}
alias p5listprojects='cd ~/Documents/p5LocalEditor/projects/ && ls'
function p5openproject {
cd ~/Documents/p5LocalEditor/projects/ && atom "$1" && live-server "$1";
}