Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Massimo Santini mapio

🎯
Focusing
Block or report user

Report or block mapio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sketchpunk
sketchpunk / QuaterionSpring.js
Created Nov 17, 2018
Spring Physics - Oscillation and Critical Dampening on Quaternions
View QuaterionSpring.js
// Resources
// https://burakkanber.com/blog/physics-in-javascript-car-suspension-part-1-spring-mass-damper/
// https://gafferongames.com/post/spring_physics/
// https://gafferongames.com/post/physics_in_3d/
// http://digitalopus.ca/site/pd-controllers/
// .. Has things about Torque
class QuaterionSpring{
constructor( damping=5, stiffness=30 ){
this.velocity = new Float32Array(4);
View enforcer.py
import types
import typing
import ast
import inspect
class TypeViolationError(TypeError):
def __init__(self, variable_name, expected_type, actual_type):
super().__init__()
self.variable_name = variable_name
@rcoh
rcoh / otp.py
Last active May 23, 2019
An implementation of Google Authenticator Compatible 2-factor Codes
View otp.py
"""
An implementation of TOTP as described in https://tools.ietf.org/html/rfc6238#section-4 aka Google Authenticator Style 2-factor Auth
"""
import base64
import datetime
import hashlib
import hmac
import sys
import struct
import time
@jriguera
jriguera / delete-dockerhub-images.sh
Last active Jul 20, 2019
Delete Docker images on DockerHub
View delete-dockerhub-images.sh
#!/bin/bash
# Based on kizbitz/dockerhub-v2-api-organization.sh at https://gist.github.com/kizbitz/175be06d0fbbb39bc9bfa6c0cb0d4721
# Example for the Docker Hub V2 API
# Returns all images and tags associated with a Docker Hub organization account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username, password, and organization
UNAME=""
UPASS=""
@bishboria
bishboria / springer-free-maths-books.md
Last active Nov 14, 2019
Springer made a bunch of books available for free, these were the direct links
@omz
omz / Dropbox File Picker.py
Last active Sep 3, 2019
Dropbox File Picker.py
View Dropbox File Picker.py
# IMPORTANT SETUP INSTRUCTIONS:
#
# 1. Go to http://www.dropbox.com/developers/apps (log in if necessary)
# 2. Select "Create App"
# 3. Select the following settings:
# * "Dropbox API app"
# * "Files and datastores"
# * "(No) My app needs access to files already on Dropbox"
# * "All file types"
# * (Choose any app name)
@aktau
aktau / imessage
Last active Sep 4, 2019
Send iMessage from the commandline
View imessage
#!/bin/sh
if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi
exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit
-- another way of waiting until an app is running
on waitUntilRunning(appname, delaytime)
repeat until my appIsRunning(appname)
tell application "Messages" to close window 1
delay delaytime
end repeat
@debasishg
debasishg / gist:8172796
Last active Nov 4, 2019
A collection of links for streaming algorithms and data structures
View gist:8172796
  1. General Background and Overview
@willurd
willurd / web-servers.md
Last active Nov 16, 2019
Big list of http static server one-liners
View web-servers.md

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@christophermanning
christophermanning / 50_top_paid_chicago_lobbyists.json
Last active May 3, 2018
Chicago Lobbyists Force-Directed Graph Visualization
View 50_top_paid_chicago_lobbyists.json
{"links":[{"target":1,"source":0},{"target":2,"source":0},{"target":3,"source":0},{"target":4,"source":0},{"target":5,"source":0},{"target":6,"source":0},{"target":7,"source":0},{"target":8,"source":0},{"target":9,"source":0},{"target":10,"source":0},{"target":11,"source":0},{"target":12,"source":0},{"target":13,"source":0},{"target":14,"source":0},{"target":15,"source":0},{"target":16,"source":0},{"target":17,"value":22,"source":0},{"target":18,"value":24,"source":0},{"target":19,"value":28,"source":0},{"target":20,"value":19,"source":0},{"target":21,"value":19,"source":0},{"target":22,"value":26,"source":0},{"target":23,"value":28,"source":0},{"target":25,"source":24},{"target":26,"source":24},{"target":27,"source":24},{"target":28,"source":24},{"target":29,"source":24},{"target":30,"source":24},{"target":31,"source":24},{"target":32,"source":24},{"target":33,"source":24},{"target":34,"source":24},{"target":35,"value":1,"source":24},{"target":36,"value":12,"source":24},{"target":23,"value":1,"source":24},{"
You can’t perform that action at this time.