Skip to content

Instantly share code, notes, and snippets.

@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@narner
narner / MachineLearningResourcesAndTools.md
Last active March 27, 2016 15:29
Machine Learning Resources and Tools
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@Klortho
Klortho / sprite.class.js
Created November 24, 2013 22:27
Javascript used in the Fabric.js Sprite demo, http://fabricjs.com/animated-sprite/. Written by Juriy Zaytsev, https://github.com/kangax.
fabric.Sprite = fabric.util.createClass(fabric.Image, {
type: 'sprite',
spriteWidth: 50,
spriteHeight: 72,
spriteIndex: 0,
initialize: function(element, options) {
options || (options = { });
@janv
janv / broken_promise.js
Last active May 6, 2023 03:55
A sad poem, written in Javascript
// Replacing callbacks with scumbacks
// Promises to call you back but then doesn't
// Getting your hopes up again
// and again
var brokenPromise = {
then: doesnt
};
function doesnt(callback){
return brokenPromise;
@mhayes
mhayes / supervisord.sh
Created March 12, 2011 01:13 — forked from danmackinlay/supervisord.sh
init.d for supervisord for Amazon Linux AMI
#!/bin/sh
# Amazon Linux AMI startup script for a supervisor instance
#
# chkconfig: 2345 80 20
# description: Autostarts supervisord.
# Source function library.
. /etc/rc.d/init.d/functions
supervisorctl="/usr/bin/supervisorctl"