Skip to content

Instantly share code, notes, and snippets.

@jlebensold
jlebensold / baseline_models.py
Last active May 7, 2019
Baselines for MorphNet paper
View baseline_models.py
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)
View gist:1429b41307e6c327f8f1f4dd796e5add
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);
View Decorator.js
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;
}
}
View gist:d05c71f2a1ceee235d0925c6dda9c602
### 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 Jun 15, 2017
Why do inline styles outperform Stylesheet.create() ?
View index.ios.js
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
steps = 20000;
@jlebensold
jlebensold / Name.php
Created Dec 12, 2011
Deleting with REST, SLIM and JSON
View Name.php
<?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 Nov 20, 2011
PUTting Data with jQuery
View Name.php
<?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 Nov 7, 2011
Building a JSON End-Point With SLIM and jQuery: Part 2 – Zendcasts.com
View home.tpl.php
<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 Oct 25, 2011
Zendcasts: Building a JSON Endpoint Part 1
View Name.php
<?php
session_start();
if (!isset($_SESSION['names']))
$_SESSION['names'] = array("jane","jim","john","emily","bill","sara");
class Name
{
public $id;
@jlebensold
jlebensold / .htaccess
Created Oct 16, 2011
Zendcasts: SLIMming Out Your Controller
View .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]