Skip to content

Instantly share code, notes, and snippets.

View thinmy's full-sized avatar
🎯
Focusing

Thinmy Patrick Alves thinmy

🎯
Focusing
View GitHub Profile
@BretFisher
BretFisher / Dockerfile
Last active May 8, 2024 20:53
Multi-stage Dockerfile example of installing dependencies with COPY --from
# any images you use later, add them here first to create aliases
# I like keeping all my versions at the top
FROM node:14.3-slim as node
FROM php:7.2.1-fpm-slim as php
FROM nginx:1.17 as nginx
# The real base image to start from
FROM ubuntu:focal-20210827 as base
# install apt stuff
@JakubOboza
JakubOboza / private-docker-regs-with-free-tiers.markdown
Created May 30, 2019 07:15
Private Docker registry with free tiers for Developers.

List of sites with free tier limits

  • Docker Hub - One private repo/image spot for free
  • Three Scale - Very generous free tier 50GB of space, 500 Pulls a month etc..
  • Canister - 20 private repos with almost no limits on free tier
  • Code Fresh - Free tier for developers

Setup your own private registry

@hakib
hakib / admin.py
Last active January 22, 2024 15:18
How to Turn Django Admin Into a Lightweight Dashboard
# https://hakibenita.com/how-to-turn-django-admin-into-a-lightweight-dashboard
from django.contrib import admin
from django.db.models import Count, Sum, Min, Max, DateTimeField
from django.db.models.functions import Trunc
from . import models
def get_next_in_date_hierarchy(request, date_hierarchy):
@gmolveau
gmolveau / uuid_user.py
Last active May 6, 2024 17:55
sqlalchemy uuid for sqlite
########################
# UUID for SQLite hack #
########################
from sqlalchemy.types import TypeDecorator, CHAR
from sqlalchemy.dialects.postgresql import UUID
import uuid
class GUID(TypeDecorator):
@slightfoot
slightfoot / page_storage_example.dart
Created April 17, 2018 20:32
Flutter PageStorage Example. Counter displayed will always be the same as the page index. Note: PageStorageKey parameter must be unique within the Route.
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Page Test',
@jmosul
jmosul / SimpleVueServiceProvider.js
Last active September 26, 2023 01:04
A simple (singleton) service provider for VueJS
class ServiceProvider {
constructor(services) {
this._services = services;
// use proxy to create a "magic getter" that will search the _services for a matching name
// then call "_makeOnce" to instantiate or return the singleton
return new Proxy(this, {
get: (provider, service) => {
service = service.charAt(0).toUpperCase() + service.slice(1);
@plindberg
plindberg / README.md
Created August 5, 2017 16:46
How to set up an AWS Lambda function for returning S3 pre-signed URLs for uploading files.

README

Granted, this is little more than an obfuscated way of having a publicly writable S3 bucket, but if you don’t have a server which can pre-sign URLs for you, this might be an acceptable solution.

For this to work, you take the following steps:

  1. Create a Lambda func, along with a new IAM role, keeping the default code.
  2. Create an API in the API Gateway.
@IgorHalfeld
IgorHalfeld / webstorm.txt
Created June 4, 2017 03:20
Webstorm server activation
http://idea.imsxm.com/
kubectl -n kube-system create sa jenkins
kubectl create clusterrolebinding jenkins --clusterrole cluster-admin --serviceaccount=<namespace>:jenkins
@paulsturgess
paulsturgess / service.js
Last active February 2, 2024 17:24
An example Service class wrapper for Axios
import axios from 'axios';
class Service {
constructor() {
let service = axios.create({
headers: {csrf: 'token'}
});
service.interceptors.response.use(this.handleSuccess, this.handleError);
this.service = service;
}