Skip to content

Instantly share code, notes, and snippets.

View zoellner's full-sized avatar
🤓
coding

Andreas Zoellner zoellner

🤓
coding
View GitHub Profile
@zoellner
zoellner / grideye.ino
Last active September 23, 2017 12:22
Grideye demo for Grid-EYE Evaluation Unit with COM-00759 RG LED Array (8x8). based on http://pewa.panasonic.com/assets/pcsd/manuals/grid-eye/grid-eye-arduino-code-examples.pdf . corrected errors in original code. Now using SPI library and serial output of data
#include <Wire.h>
#include <SPI.h>
//define our colors for LED Array
#define GREEN 0x01
#define RED 0x02
#define ORANGE 0x03
//define the SPI pins for the LED Array
#define SLAVESELECT 10//ss
char ledArray [64];
byte pixelTempL;
@zoellner
zoellner / ebextensions_loggly.config
Created March 26, 2014 02:46
Configure AWS Elastic Beanstalk to send syslog to loggly.com
#
# Install loggly.com on AWS Elastic Beanstalk
# Tested with node.js environment
# Save this file as .ebextensions/loggly.config
# Replace TOKEN and ACCOUNT with your own
# Deploy per normal scripts or aws.push.
#
commands:
01_loggly_dl:
@zoellner
zoellner / ebextensions_nginx_loggly.config
Created March 29, 2014 06:30
Configure AWS Elastic Beanstalk syslog to poll nginx logs (in order to send them to loggly)
#
# configure rsyslogd to include logfiles from nginx/apache
# needs 010_loggly.config
# Save this file as .ebextensions/015_nginx-loggly.config
# replace TOKEN
# Deploy per normal scripts or aws.push. To help debug the push, ssh & tail /var/log/cfn-init.log
# See Also /var/log/eb-tools.log
#
files:
# Modified from: http://stackoverflow.com/a/11010158/215200
$fromFolder = "D:\FOLDER\"
$rootName = "FILENAME"
$ext = "EXT"
$numFiles = 16
$from = "{0}{1}.{2}" -f ($fromFolder, $rootName, $ext)
$fromFile = [io.file]::OpenRead($from)
@zoellner
zoellner / Javascript ISO country code to country name conversion
Last active June 30, 2020 19:09 — forked from maephisto/Javascript ISO country code to country name conversion
Javascript ISO 3166-1 alpha-2 country code to ISO 3166-1 alpha-3 country code conversion
var isoCode3 = {
AF: 'AFG',
AX: 'ALA',
DZ: 'DZA',
AL: 'ALB',
AS: 'ASM',
AD: 'AND',
AO: 'AGO',
AI: 'AIA',
AQ: 'ATA',
@zoellner
zoellner / mixpanelDeletePeople.js
Created June 3, 2016 23:19
Delete people profiles from mixpanel based on distinct ids in csv file
'use strict';
//Delete people profiles from mixpanel based on distinct ids in people.csv (id in first column)
//provide mixpanel token in environment variable MIXPANEL_TOKEN. change people.csv to your filename
//see https://mixpanel.com/help/reference/http for mixpanel API documentation
var request = require('request');
var _h = require('highland');
_h(_h.wrapCallback(require('fs').readFile)('./people.csv')) //change filename here
.split()
@zoellner
zoellner / deleteTaskDefinition.js
Last active February 19, 2019 19:48
Delete AWS ECS Task Definition for Task Family
'use strict';
const AWS = require('aws-sdk');
const _h = require('highland');
const ecs = new AWS.ECS({region: process.env.AWS_REGION || 'us-east-1'});
let familyPrefix = null;
if (process.argv.length >= 3){
@zoellner
zoellner / index.js
Last active November 8, 2017 19:01
mongoose-bug-set-pre-save-hook-with-select
'use strict';
//see https://github.com/Automattic/mongoose/issues/5800
const mongoose = require('mongoose');
const assert = require('assert');
mongoose.Promise = global.Promise;
mongoose.connect('mongodb://localhost/mongoose-gh-5800');
@zoellner
zoellner / docker-build-private-github.md
Last active December 13, 2023 22:25
Extract Github token for Docker build with private repo

Note: There are better ways to do this by now. Check https://docs.docker.com/develop/develop-images/build_enhancements/#new-docker-build-secret-information for details

In order to access packages in private github repositories a Dockerfile might contain statements like this:

RUN git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
RUN npm install --ignore-scripts --quiet && npm cache clean --force
RUN git config --global --unset url."https://${GITHUB_TOKEN}@github.com/".insteadOf
@zoellner
zoellner / .bash_profile
Last active January 13, 2019 20:44 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management