Skip to content

Instantly share code, notes, and snippets.

View patniemeyer's full-sized avatar

Patrick Niemeyer patniemeyer

View GitHub Profile
@hyun007
hyun007 / span.io-api-documentation.md
Last active September 5, 2024 19:29
span.io api documentation

Span.io API Documentation

The Span API does not at this time require any authentication. This will probably change in the future.

Description: Gets panel summary, firmware version, door state, serial number, network status Request: GET /api/v1/status Response:

{
  "software": {
    "firmwareVersion": "spanos2/r202216/04",
@sachaarbonel
sachaarbonel / main.dart
Created June 5, 2019 07:10 — forked from jpotterm/main.dart
Flutter SVG Path Converter
// Generates canvas drawing commands from an SVG path string
import 'package:path_parsing/path_parsing.dart';
void main(List<String> args) {
if (args.length < 3) {
print('Usage: width height path_string');
return;
}
@matteocrippa
matteocrippa / flutter.md
Last active September 20, 2024 13:10
Flutter Cheatsheet

Flutter

A quick cheatsheet of useful snippet for Flutter

Widget

A widget is the basic type of controller in Flutter Material. There are two type of basic Widget we can extend our classes: StatefulWidget or StatelessWidget.

Stateful

StatefulWidget are all the widget that interally have a dynamic value that can change during usage. It can receive an input value in the constructor or reference to functions. You need to create two classes like:

const fs = require("fs");
const solc = require('solc')
let Web3 = require('web3');
let web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));
var input = {
'strings.sol': fs.readFileSync('strings.sol', 'utf8'),
'StringLib.sol': fs.readFileSync('StringLib.sol', 'utf8'),
@karpathy
karpathy / nes.py
Last active August 15, 2024 09:41
Natural Evolution Strategies (NES) toy example that optimizes a quadratic function
"""
A bare bones examples of optimizing a black-box function (f) using
Natural Evolution Strategies (NES), where the parameter distribution is a
gaussian of fixed standard deviation.
"""
import numpy as np
np.random.seed(0)
# the function we want to optimize