Skip to content

Instantly share code, notes, and snippets.

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

Nailson Landim nailsonlinux

🏠
Working from home
View GitHub Profile
@vndmtrx
vndmtrx / Makefile
Created November 30, 2020 16:53
My Makefile for bootstrapping Python projects
SHELL := /bin/bash
.SHELLFLAGS = -e -c
.ONESHELL:
.PHONY: clean freeze
PRJ_NAME = Project Name
.venv: .venv/bin/activate
import re
class Name:
def __get__(self, obj, objtype=None):
return self.value
def __set__(self, obj, value):
if len(value) > 20:
raise ValueError("Name cannot exceed 20 characters.")
self.value = value
@TakaoNarikawa
TakaoNarikawa / convert.py
Created April 24, 2020 21:27
Convert darknet pre-trained model to CoreML model
#! /usr/bin/env python
"""
Reads Darknet config and weights and creates Keras model with TF backend.
"""
import argparse
import configparser
import io
import os
@mattwang44
mattwang44 / downloadFromS3_async.py
Last active April 2, 2024 07:56
async download from AWS S3 using aiobotocore
import os
import asyncio
import aiobotocore
import io
from PIL import Image
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
@BretFisher
BretFisher / docker-for-windows.md
Last active February 1, 2024 21:57
Getting a Shell in the Docker for Windows Moby VM

2018 Update: Easiest option is Justin's repo and image

Just run this from your CLI and it'll drop you in a container with full permissions on the Moby VM. Only works for Moby Linux VM (doesn't work for Windows Containers). Note this also works on Docker for Mac.

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1

@xxlukas42
xxlukas42 / esp32_internal_hall.ino
Last active April 21, 2024 04:16
Arduino source code for ESP32 internal temperature sensor and hall sensor
void setup() {
Serial.begin(115200);
}
void loop() {
int measurement = 0;
measurement = hallRead();
# Use TDD principles to build out name functionality for a Person.
# Here are the requirements:
# - Add a method to return the full name as a string. A full name includes
# first, middle, and last name. If the middle name is missing, there shouldn't
# have extra spaces.
# - Add a method to return a full name with a middle initial. If the middle name
# is missing, there shouldn't be extra spaces or a period.
# - Add a method to return all initials. If the middle name is missing, the
# initials should only have two characters.
#
@nazgob
nazgob / gist:2367583
Created April 12, 2012 14:13
vagrant cheatsheet
# setup vagrant
gem install vagrant
vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
mkdir my_vagrant_test
cd my_vagrant_test
vagrant init lucid32
vim Vagrantfile
vagrant up
vagrant ssh