Skip to content

Instantly share code, notes, and snippets.

View green-coder's full-sized avatar
🌱

Vincent Cantin green-coder

🌱
View GitHub Profile
@a0726h77
a0726h77 / gist:f958138f0ecaa992f3d52df15a60fbc5
Last active October 19, 2016 09:57
bad_rice_tracking.py
#!/usr/bin/env python
# encoding: utf-8
import cv2
import numpy as np
READ_PICTURE = 1 # 0 => read from camera
PICTURE_PATH = "sample.jpg"
THRESHOLD = 180
@jasongilman
jasongilman / atom_clojure_setup.md
Last active May 11, 2024 02:25
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

Keybinding Description
C-h C-a help start screen
C-x C-c save-buffers-kill-emacs (exit emacs)
C-g keyboard-quit
M-esc esc keyboard-escape-quit
C-x z Magic. repeat last operation
M-! shell command
ESC ! shell-command
ESC x compile compile ("make -k" is default)

Meteor Alternatives Per Feature

This table was created in 2015 so may be quite outdated today.

Feature Meteor Solution Alternative Solutions Description
Live DB Sync [livequery][lq] ([mongo-oplog]), [ddp] RethinkDB, Redis, ShareDB, [npm:mongo-oplog], [firebase], etc. Push DB updates to client/server.
Latency Compensation, Optimistic UI [minimongo][mm] [RethinkDB][lcr], [mWater/minimongo] (fork, not ws but http, browserify) Imitate successful db query on client before it is done.
Isomorphic Code [isobuild] & isopacks browserify Write one code for server/client/mobile.
Isomorphic Packaging [isobuild], atmosphere No more separate packages for server & client. Get bower + npm + mobile.
@ilyaigpetrov
ilyaigpetrov / client-server-data-sync.markdown
Last active January 26, 2020 14:58
Client/Server Data Synchronization Solutions | by https://git.io/ilyaigpetrov

Client/Server Data Synchronization

Open Source

  • Redis
    In-memory db with notifications, may be used alongside other DB.
  • Meteor
    • MongoDB | Livequery | server DDP | DDP client | minimongo
    • Livequery for DB updates subscriptions (MongoDB)
    • Minimongo is MongoDB imitation, used for latency compenstion.
  • Opinionated, heavy, not very modular.
anonymous
anonymous / RadialLayout.cs
Created September 14, 2015 12:03
Radial Layouts within Unity3Ds UI system
using UnityEngine;
using UnityEngine.UI;
/*
Radial Layout Group by Just a Pixel (Danny Goodayle) - http://www.justapixel.co.uk
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@ericelliott
ericelliott / defaults-overrides.md
Last active May 7, 2023 13:52
ES6 defaults / overrides pattern

ES6 Defaults / Overrides Pattern

Combine default parameters and destructuring for a compact version of the defaults / overrides pattern.

function foo ({
    bar = 'no',
    baz = 'works!'
  } = {}) {
@Integralist
Integralist / 0. description.md
Last active June 17, 2023 21:49
Clojure deftype, defrecord, defprotocol
  • defprotocol: defines an interface
  • deftype: create a bare-bones object which implements a protocol
  • defrecord: creates an immutable persistent map which implements a protocol

Typically you'll use defrecord (or even a basic map);
unless you need some specific Java inter-op,
where by you'll want to use deftype instead.

Note: defprotocol allows you to add new abstractions in a clean way Rather than (like OOP) having polymorphism on the class itself,

Unary operators

(and the oddities of number evaluation in JavaScript)

Type conversion, typecasting, and coercion are different ways of, implicitly or explicitly, changing an entity of one data type into another. [--wikipedia][wikipedia]


Unary operators, or "typeof +'foo' === huh?"

@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences