Skip to content

Instantly share code, notes, and snippets.

View alexgorbatchev's full-sized avatar
👋

Alex Gorbatchev alexgorbatchev

👋
View GitHub Profile
@alexgorbatchev
alexgorbatchev / summary
Created June 14, 2024 04:58 — forked from phaedryx/summary
Loyalty and Layoffs by David Brady
Original text here: https://whydavewhy.com/2013/08/16/loyalty-and-layoffs/
blueprint:
name: Send Camera snapshot when if a binary sensor's state turns 'off' to 'on', with Conditions
description: This automation blueprint creates a camera snapshot if motion is detected, or if a binary sensor's state turns 'off' to 'on', and sends a notification to your phone with the picture. (v1.01)
domain: automation
input:
condition:
name: Add Condition(s)
description: Add conditions if needed
default: []
selector:
@alexgorbatchev
alexgorbatchev / generate_cert.sh
Created September 9, 2014 13:26
Generate self signed https certificates for node.js express/hapi/etc
#!/bin/bash
openssl genrsa -out key.pem
openssl req -new -key key.pem -out csr.pem
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
rm csr.pem
@alexgorbatchev
alexgorbatchev / FastLEDDisk.ino
Created September 8, 2017 22:50 — forked from adammhaile/FastLEDDisk.ino
Examples of using angle and radius to select pixels on a circular pixel layout using FastLED
#include "FastLED.h"
#define NUM_LEDS 255
#define DATA_PIN SPI_DATA
#define CLOCK_PIN SPI_CLOCK
// Define the array of leds
CRGB leds[NUM_LEDS];
-----------------------------------------------------------------------------
"Efficient and Portable Combined Random Number Generators",
Pierre L'Ecuyer, Communications of the ACM, June, 1988 (v31 #6)
"Random Number Generators: Good Ones Are Hard To Find",
Park, Stephen K., and Miller, Keith W.,
Communications of the ACM, October, 1988.
(see below)
Conclusions :- horrible random (sic) number generators are used by people
@alexgorbatchev
alexgorbatchev / gist:8428232
Created January 14, 2014 23:48
MEAN folder structure
/node_modules
/package.json
/src
/node_modules
/client -> ../client
/server -> ../server
/shared -> ../shared
/client
/apps
/main
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
sudo apt-get update
sudo apt-get upgrade
var sys = require("sys");
var http = require("http");
var connections=[];
function update() {
if (connections.length) {
connections.forEach(function(c) {
sys.puts(c);
c.write('oi\n');
@alexgorbatchev
alexgorbatchev / merge.sh
Created September 7, 2014 16:22
Merge one git repo into another preserving history
#!/bin/bash
other_project=$1
git remote add -f $other_project ../$other_project
git merge -s ours --no-commit $other_project/master
git read-tree --prefix=$other_project -u $other_project/master
git commit -m "Merged $other_project"