Skip to content

Instantly share code, notes, and snippets.

View thonly's full-sized avatar
😎
Now podcasting from my Sequoia Treehouse in Fresno, CA

Thon Ly thonly

😎
Now podcasting from my Sequoia Treehouse in Fresno, CA
View GitHub Profile
@thonly
thonly / extreme.js
Last active September 21, 2021 12:39
Episode 5 #oneliner
sb.onclick = () => pw.style.outlineColor = pw.value.split("").some(character => !isNaN(character)) ? "green" : "red"
@thonly
thonly / index.js
Created August 13, 2021 01:21
One-Liner Podcast Episode 1
// Solution 1
document.querySelector("p").style.color = "green"
// Solution 2
document.getElementById("p1").style.color = "green"
// Solution 3
p1.style.color = "green"
@thonly
thonly / index.html
Last active August 13, 2021 01:20
One-Liner Podcast Episode 1
<p id="p1">Hello World</p>
@thonly
thonly / external.css
Last active April 28, 2021 22:15
Example External Files
body {
background: orange;
}
@thonly
thonly / BoxOfficeMovie.sol
Last active September 1, 2018 04:04
BoxOfficeMovie.sol
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol";
/** @title A Box Office Movie that inherits ERC20 */
contract BoxOfficeMovie is StandardToken {
uint8 public constant decimals = 0;
string public name;
string public symbol;
@thonly
thonly / BoxOffice.sol
Last active August 28, 2018 03:55
BoxOffice.sol
pragma solidity ^0.4.24;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import {HeartBankCoinInterface as Kiitos} from "./HeartBankCoinInterface.sol";
import {BoxOfficeMovie as Movie} from "./BoxOfficeMovie.sol";
/** @title Box Office factory that creates ERC20 movie tickets */
contract BoxOffice {
using SafeMath for uint;
@thonly
thonly / BoxOfficeTheater.js
Created August 28, 2018 00:23
BoxOfficeTheater.js
import React, { Component } from "react";
import { Container, Embed, List, Label, Breadcrumb, Dimmer, Loader, Message } from "semantic-ui-react";
import getAccount, { BoxOffice, Movie } from "../../utils/contracts";
import { Link } from "../../routes";
import Layout from "../../components/Layout";
import AudienceMembers from "../../components/contents/AudienceMembers";
import makeShorter, { toDollars } from "../../utils/offchainwork";
const isAudienceMember = (account, members) => {
for (let member of members) {
@thonly
thonly / BoxOfficeMovie.js
Created August 28, 2018 00:22
BoxOfficeMovie.js
import React, { Component } from "react";
import { Progress, Grid, Button, Icon, Dimmer, Loader } from "semantic-ui-react";
import getAccount, { BoxOffice, Movie } from "../../utils/contracts";
import { Link } from "../../routes";
import Layout from "../../components/Layout";
import MovieDetails from "../../components/contents/MovieDetails";
import MovieStats from "../../components/contents/MovieStats";
import TokenDetails from "../../components/contents/TokenDetails";
import BuyTickets from "../../components/forms/BuyTickets";
import Withdrawals from "../../components/contents/Withdrawals";
@thonly
thonly / MakeFilm.js
Created August 28, 2018 00:21
MakeFilm.js
import React, { Component } from "react";
import { Dimmer, Loader, Step, Icon } from "semantic-ui-react";
import getAccount, { Kiitos, BoxOffice, Movie } from "../../utils/contracts";
import Layout from "../../components/Layout";
import UpdateFilm from "../../components/forms/UpdateFilm";
import makeShorter, { toDollars } from "../../utils/offchainwork";
class MakeFilm extends Component {
static async getInitialProps(props) {
const kiitos = await Kiitos.deployed();
@thonly
thonly / HeartBankStudio.js
Created August 28, 2018 00:20
HeartBankStudio.js
import React, { Component } from "react";
import { Button, Grid, Icon, Sticky, Dimmer, Loader } from "semantic-ui-react";
import getAccount, { Kiitos, BoxOffice } from "../utils/contracts";
import { Link } from "../routes";
import Layout from "../components/Layout";
import BoxOfficeMovies from "../components/contents/BoxOfficeMovies";
import BoxOfficeStats from "../components/contents/BoxOfficeStats";
import makeShorter, { toDollars } from "../utils/offchainwork";
class HeartBankStudio extends Component {