Skip to content

Instantly share code, notes, and snippets.

View tyrostone's full-sized avatar
🐈

Laura Stone tyrostone

🐈
View GitHub Profile
// Sample file used to learn Backbone views
$(function() {
var User = Backbone.Model.extend({
});
var UserList = Backbone.Collection.extend({
model: User,
url: "users.json"
});
// Users view
@tyrostone
tyrostone / gist:a64a5698285771f193ee
Created February 26, 2015 17:25
jQuery.getJSON demo
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery.getJSON demo</title>
<style>
img {
height: 100px;
float: left;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
package main
import (
"crypto/tls"
"flag"
"fmt"
"golang.org/x/net/html"
"io"
"log"
"net"
package main
import (
"encoding/csv"
"fmt"
"os"
"strconv"
"time"
)
@tyrostone
tyrostone / index.html
Created October 16, 2016 23:23
Simple Drag and Drop with Observables
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<!-- <button id="button">Click me</button> -->
<div id="parent" style="width:200px; height:200px; background-color:red">
""" catfact.py
Returns a random cat fact.
Facts obtained from https://catfacts-api.appspot.com/
"""
import json
import sys
try:
import requests
class Button extends React.Component {
render() {
return (
<button onClick={() => this.props.onClickFunction(this.props.incrementValue)}>
+{this.props.incrementValue}
</button>
);
}
};
const Card = (props) => {
return (
<div style={{margin: '1em'}}>
<img width="75" src={props.avatar_url} />
<div style={{display: 'inline-block', marginLeft: 10}}>
<div style={{fontSize: '1.25em', fontWeight: 'bold'}}>{props.name}</div>
<div>{props.company}</div>
</div>
</div>
);
@tyrostone
tyrostone / app.css
Created April 24, 2017 19:28
Play Nine React App
.fa-star {
margin: 0.5em;
font-size: 24px;
}
span {
display: inline-block;
margin: 0.5em;
text-align: center;
background-color: #ccc;