Skip to content

Instantly share code, notes, and snippets.

@jlebensold
jlebensold / baseline_models.py
Last active May 7, 2019 13:49
Baselines for MorphNet paper
from pathlib import Path
import torch
import torch.nn as nn
import torch.nn.functional as F
class TanhNet(nn.Module):
def __init__(self, in_features, h_units):
super(TanhNet, self).__init__()
self.fc1 = nn.Linear(in_features, h_units)
let pastryList: list(pastry) = [
{ label: "🥐 Croissants", flour: 0.7, butter: 0.5, sugar: 0.2, eggs: 0.0 },
{ label: "🍪 Cookies", flour: 0.5, butter: 0.4, sugar: 0.5, eggs: 0.2 },
{ label: "🥞 Pancakes", flour: 0.7, butter: 0.5, sugar: 0.3, eggs: 0.3 },
{ label: "🍩 Dougnuts", flour: 0.5, butter: 0.2, sugar: 0.8, eggs: 0.1 }
];
let theList = List.map((item) => <Text>{item.label}</Text>, pastryList);
@jlebensold
jlebensold / Decorator.js
Created September 27, 2017 18:19
Logger Decorator
function logger() {
return function (target, key, descriptor) {
const initialValue = descriptor.value;
descriptor.value = function() {
console.log(`>"${key}" with`, arguments);
return initialValue.apply(null, arguments);
};
return descriptor;
}
}
### Keybase proof
I hereby claim:
* I am jlebensold on github.
* I am jonlebensold (https://keybase.io/jonlebensold) on keybase.
* I have a public key ASA6FXU5tOFj86Q3up5-PMvKM3yGHdjp54wpJfC8ZzDG9wo
To claim this, I am signing this object:
@jlebensold
jlebensold / index.ios.js
Created June 15, 2017 19:17
Why do inline styles outperform Stylesheet.create() ?
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
steps = 20000;
@jlebensold
jlebensold / Name.php
Created December 12, 2011 21:07
Deleting with REST, SLIM and JSON
<?php
session_start();
if (!isset($_SESSION['names']))
$_SESSION['names'] = array("jane","jim","john","emily","bill","sara");
class Name
{
public $id;
@jlebensold
jlebensold / Name.php
Created November 20, 2011 17:04
PUTting Data with jQuery
<?php
session_start();
if (!isset($_SESSION['names']))
$_SESSION['names'] = array("jane","jim","john","emily","bill","sara");
class Name
{
public $id;
@jlebensold
jlebensold / home.tpl.php
Created November 7, 2011 21:52
Building a JSON End-Point With SLIM and jQuery: Part 2 – Zendcasts.com
<html>
<head>
<title>Names Hello</title>
<script type="text/javascript" src="/js/jquery-1.5.1.js"></script>
<style>
*
{
margin: 0 0;
padding: 0 0;
@jlebensold
jlebensold / Name.php
Created October 25, 2011 21:02
Zendcasts: Building a JSON Endpoint Part 1
<?php
session_start();
if (!isset($_SESSION['names']))
$_SESSION['names'] = array("jane","jim","john","emily","bill","sara");
class Name
{
public $id;
@jlebensold
jlebensold / .htaccess
Created October 16, 2011 17:31
Zendcasts: SLIMming Out Your Controller
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]