Skip to content

Instantly share code, notes, and snippets.

View netoisc's full-sized avatar
🏠
Working from home

Ernesto netoisc

🏠
Working from home
View GitHub Profile

Boost Prompt

A prompt to boost your lazy "do this" prompts. Install with one of the buttons below.

Install in VS Code Install in VS Code Insiders

Use

@cmackenzie1
cmackenzie1 / docker-compose.yml
Last active December 26, 2024 12:43
Docker Compose for DynamoDB Local and Admin UI
version: '3.7'
services:
dynamodb-local:
image: amazon/dynamodb-local:latest
container_name: dynamodb-local
ports:
- "8000:8000"
dynamodb-admin:
image: aaronshaf/dynamodb-admin
@proustibat
proustibat / shapeArea.js
Last active March 3, 2021 06:19
We will define an n-interesting polygon. Your task is to find the area of a polygon for a given n.
const shapeArea = n => Math.pow( n, 2 ) + Math.pow( n - 1, 2 );
@jukben
jukben / android_Fastlane
Last active October 28, 2021 10:51
Example of Circle CI config for React Native CI (Appcenter, Kotlin, Swift, RN 0.49+, Haul packager, signing via Match, be sure that you have set env MATCH_PASSWORD, FASTLANE_PASSWORD and SLACK_URL)
fastlane_version "2.64.1"
default_platform :android
platform :android do
lane :beta do
gradle(task: "assembleRelease")
appcenter_upload(
api_token: "",
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@LegoStormtroopr
LegoStormtroopr / README.md
Created May 3, 2017 01:26
Handling AWS-ELB terminating a healthy django instance when accessed from an invalid hostname

Handling AWS-ELB terminating a healthy django instance when accessed from an invalid hostname

When spinning up a new service, Amazon Elastic LoadBalancer needs to check if the service is live and running. This check is done from an IP (from any IP in a private IP range) to the service, this is done by the ELB just doing a simple GET request to a specified path, with no host information - for example GET /heatbeat.

If this instance is a Django service, regardless of the page accessed, this call will fail as in a properly setup Django it is very unlikely that the IP will be in Django's settings.ALLOWED_HOSTS settings.

There are two ways around this, either:

a. Add every IP from every private IP range into your Django project's ALLOWED_HOSTS settings

import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@haxoza
haxoza / admin.py
Created April 17, 2015 09:03
Django custom user model & custom admin
from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from .models import *
from forms import UserChangeForm, UserCreationForm
class UserAdmin(auth_admin.UserAdmin):
fieldsets = (
(None, {'fields': ('email', 'password')}),
('Personal info', {'fields': ('first_name', 'last_name', 'twitter', 'photo', 'event')}),
@danielflippance
danielflippance / list-group-horizontal.css
Created July 7, 2014 23:31
Bootstrap list-group-horizontal
.list-group-horizontal .list-group-item {
display: inline-block;
}
.list-group-horizontal .list-group-item {
margin-bottom: 0;
margin-left:-4px;
margin-right: 0;
}
.list-group-horizontal .list-group-item:first-child {
border-top-right-radius:0;
@staltz
staltz / introrx.md
Last active May 24, 2026 14:25
The introduction to Reactive Programming you've been missing