Skip to content

Instantly share code, notes, and snippets.

View DanLipsitt's full-sized avatar

Dan Lipsitt DanLipsitt

  • Tempo Automation
  • United States
View GitHub Profile
  • Open linux env

To start with I am using Multipass.

Install Host Packages

https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html#build-host-packages

$> sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 python3-sphinx libegl1-mesa libsdl1.2-dev python3-subunit mesa-common-dev zstd liblz4-tool file locales libacl1
"""A set of helpers for reversing urls, similar to Django ``reverse``.
Usage:
.. code:: python
@router.get("/class/{class_id}")
async def get_class(request: Request, class_id: int = Path(...)):
student_route = get_route(request.app, "list_students")
class_students_url = URLFactory(student_route).get_path(class_id=class_id)
from keras.layers import Conv2D, BatchNormalization, Input, GlobalAveragePooling2D, Dense
from keras.models import Model
from keras.layers.advanced_activations import LeakyReLU
# function for building the discriminator layers
def build_discriminator(start_filters, spatial_dim, filter_size):
# function for building a CNN block for downsampling the image
def add_discriminator_block(x, filters, filter_size):
x = Conv2D(filters, filter_size, padding='same')(x)
###########
# Checks if the given cask needs to be upgraded.
#
#!/bin/bash
set -o pipefail
source /etc/profile
if [ $# -eq 0 ]; then
ARGS=($(brew cask list))
else
@butla
butla / wait_for_tcp_port.py
Last active December 8, 2022 19:52
Waiting for a TCP port to start accepting connections (Python >=3.6)
"""
MIT License
Copyright (c) 2017 Michał Bultrowicz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@egdelwonk
egdelwonk / Talk notes.md
Last active May 12, 2017 22:02
es2015 for python devs

Imports

Python:

import <module>
from <module> import defaultMember
from <module> import *
import <module> as <name>
@camjackson
camjackson / login-form.js
Last active November 17, 2019 09:18
Basic stateless React.js form
/*
This is obviously a very basic example. It takes props to render the inputs with their values, and
to render any error state. It also takes props to update the state, or submit the form.
*/
const LoginForm = props => (
<form onSubmit={props.onSubmit}>
<input type="text" name="username" onChange={props.onChangeUsername} value={props.username}/>
{ props.userNameError && <span class="error">{ props.usernameError }</span> }
<input type="password" name="password" onChange={props.onChangePassword} value={props.password}/>