Skip to content

Instantly share code, notes, and snippets.

View makafanpeter's full-sized avatar

Peter Makafan makafanpeter

View GitHub Profile
@sdymj84
sdymj84 / serverless.yml
Created April 2, 2019 19:22
Serverless framework global secondary index example
service: apt-api
# Use the serverless-webpack plugin to transpile ES6
plugins:
- serverless-webpack
- serverless-offline
custom:
# Our stage is based on what is passed in when running serverless
# commands. Or fallsback to what we have set in the provider section.
@gonzaloplaza
gonzaloplaza / minikube_ubuntu_installation.md
Last active February 17, 2022 06:14
Minikube installation on Ubuntu 16.04 LTS

Minikube Installation on Ubuntu 16.04 LTS

Overview:

  1. Install hypervisor (Virtualbox)
  2. Get and install Kubectl (repositories)
  3. Get and install Minikube last version
  4. Start and Test Minikube local cluster and expose demo service

Install VirtualBox hypervisor

public class ApplicationUserManager : UserManager<AspNetUser, long>
{
public ApplicationUserManager(IUserStore<AspNetUser, long> store)
: base(store)
{
}
public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options,
IOwinContext context)
{
@ericmjl
ericmjl / ds-project-organization.md
Last active July 25, 2025 01:08
How to organize your Python data science project

UPDATE: I have baked the ideas in this file inside a Python CLI tool called pyds-cli. Please find it here: https://github.com/ericmjl/pyds-cli

How to organize your Python data science project

Having done a number of data projects over the years, and having seen a number of them up on GitHub, I've come to see that there's a wide range in terms of how "readable" a project is. I'd like to share some practices that I have come to adopt in my projects, which I hope will bring some organization to your projects.

Disclaimer: I'm hoping nobody takes this to be "the definitive guide" to organizing a data project; rather, I hope you, the reader, find useful tips that you can adapt to your own projects.

Disclaimer 2: What I’m writing below is primarily geared towards Python language users. Some ideas may be transferable to other languages; others may not be so. Please feel free to remix whatever you see here!

#include <Arduino.h>
#include <Event.h>
#include <Timer.h>
#include <EEPROM.h>
#include <ArduinoJson.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <YoutubeApi.h>
@rogeliorv
rogeliorv / brackets_equilibrium.py
Created February 22, 2017 20:57
Given a string containing opening braces '(' and closing braces ')' find the index where you have the same number of opening and closing braces
# Codility challenge
# Given a string containing opening braces '(' and closing braces ')'
# Return the index where you have the same number of opening and closing braces
# Example:
# Given '(())' the equilibrium index is two because there are the same number
# of opening brackets to the left as there are closing brackets to the right
#
# Given '(((' the equilibrium index is 0 because there are no opening brackets
# before index 0 and there are 0 closing brackets at that position
#

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@gashupl
gashupl / Program.cs
Created September 30, 2016 11:34
RSA Encrypting & Descrypting in C# sample
using System;
using System.Security.Cryptography;
using System.Text;
namespace RsaEncryptionSample
{
class Program
{
static void Main(string[] args)
{
@kixorz
kixorz / aws_lambda_public_ip.js
Last active February 14, 2024 07:39
Function retrieving AWS Lambda public IP address. Copy and paste this to your Lambda console, use standard permissions, execute and observe the log to see the public IP address of your Lambda function.
var http = require('http');
exports.handler = function(event, context) {
http.get('http://httpbin.org/get', function(res) {
var body = '';
res.on('data', function(chunk) {
body += chunk;
});
res.on('end', function() {
@anamorph
anamorph / HOWTO Install AWS CLI on Debian.md
Last active February 2, 2025 22:29
HOWTO Install AWS CLI on Debian

HOWTO Install AWS CLI on Debian

1. installing pre-reqs

sudo apt-get install python python-pip

2. installing the cli:

sudo pip install awscli

3. configuring the cli:

aws configure