Skip to content

Instantly share code, notes, and snippets.

View JulienSansot's full-sized avatar

Julien Sansot JulienSansot

View GitHub Profile
@JulienSansot
JulienSansot / How to find where a method is defined at runtime
Created October 5, 2015 02:58
How to find where a method is defined at runtime?
CSV.new('string').method(:flock).source_location
@JulienSansot
JulienSansot / mysql DB sizes
Created October 9, 2015 08:09
mysql DB sizes
SELECT table_schema "DB Name",
Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM information_schema.tables
GROUP BY table_schema;
@JulienSansot
JulienSansot / sublime text settings
Last active November 26, 2018 16:50
sublime text settings
{
"auto_match_enabled": false,
"detect_indentation": false,
"ignored_packages":
[
"Vintage"
],
"show_full_path": true,
"tab_size": 2,
"trim_trailing_white_space_on_save": true,
@JulienSansot
JulienSansot / docker_compose mongo_postgres_redis
Created October 22, 2015 09:07
docker_compose mongo/postgres/redis
mongo:
restart: always
image: mongo:3.0.5
volumes:
- ~/docker_mongodb_data:/data/db
ports:
- "27017:27017"
postgres:
restart: always
@JulienSansot
JulienSansot / .gitignore
Last active November 13, 2015 06:50
Test1
npm-debug.log
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body{
font-family: sans;
padding: 10px;
}
svg path{
// This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/).
[];
var colorbrewer = {YlGn: {
3: ["#f7fcb9","#addd8e","#31a354"],
4: ["#ffffcc","#c2e699","#78c679","#238443"],
5: ["#ffffcc","#c2e699","#78c679","#31a354","#006837"],
6: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],
7: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
8: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
@JulienSansot
JulienSansot / pivot_coordinates.rb
Last active November 19, 2015 02:05
pivot coordinates
# ruby pivot_coordinates.rb 2 1 45
def pivot_coordinate(x, y, degrees)
radians = degrees * (Math::PI/180)
cos = Math.cos(radians)
sin = Math.sin(radians)
{
x: x * cos - y * sin,
y: x * sin + y * cos
}
@JulienSansot
JulienSansot / README.md
Created November 24, 2015 02:18 — forked from rkirsling/LICENSE
Directed Graph Editor

Click in the open space to add a node, drag from one node to another to add an edge.
Ctrl-drag a node to move the graph layout.
Click a node or an edge to select it.

When a node is selected: R toggles reflexivity, Delete removes the node.
When an edge is selected: L(eft), R(ight), B(oth) change direction, Delete removes the edge.

To see this example as part of a larger project, check out Modal Logic Playground!

@JulienSansot
JulienSansot / palette_viewer
Created April 4, 2016 05:39
palette viewer
https://jsfiddle.net/3qLh5hj1/