Skip to content

Instantly share code, notes, and snippets.

Brian Takita btakita

Block or report user

Report or block btakita

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@btakita
btakita / index.ts
Last active Nov 9, 2019
AWS CDK for a static https website
View index.ts
#!/usr/bin/env node
// See https://github.com/aws-samples/aws-cdk-examples/tree/master/typescript/static-site/
import { Stack, App, StackProps } from '@aws-cdk/core'
import { CONTEXT_ENV } from '@aws-cdk/cx-api'
import { StaticSite } from './static-site'
type Context = {
domain: string,
subdomain: string,
}
const ctx = JSON.parse(process.env[CONTEXT_ENV] as string) as Context
@btakita
btakita / resume.json
Last active Aug 19, 2019
resume.json
View resume.json
{
"meta": {"theme": "flat"},
"basics": {
"name": "Brian Takita",
"label": "Fullstack Web & Mobile App Developer",
"picture": "",
"email": "brian.takita@gmail.com",
"website": "https://briantakita.com",
"summary": "A summary of John Doe...",
"profiles": [
@btakita
btakita / input.txt
Last active Mar 25, 2019
MaxMyInterest knapsack interview problem
View input.txt
$15.05
mixed fruit,$2.15
french fries,$2.75
side salad,$3.35
hot wings,$3.55
mozzarella sticks,$4.20
sampler plate,$5.80
View child-store.html
<script>
export default {
computed: {
config__issues: ({ store, $config__issues }) => (store ? store.get().config__issues : $config__issues) || {},
labels: ({ config__issues }) => config__issues.labels || {},
order: ({ config__issues }) => config__issues.order || [],
titles: ({ bar__issues }) => ( bar__issues && bar__issues.titles) || {},
values: ({ bar__issues }) => ( bar__issues && bar__issues.values) || {},
representations: ({ bar__issues }) => ( bar__issues && bar__issues.representations) || {},
weights: ({ bar__issues }) => ( bar__issues && bar__issues.weights) || {},
View App.html
<p>This is a top-level element.</p>
<Nested on:event1=event1(event) on:event2:1=event21(event)/>
<script>
import Nested from './Nested.html';
export default {
methods: {
event1(event) {
console.debug('event1')
@btakita
btakita / resolve__rollup.js
Last active Mar 23, 2018
Resolve from current directory
View resolve__rollup.js
/** Add this into the rollup plugins array
resolve__rollup({
paths: ['.', 'node_modules'],
extensions: ['.mjs', '.js', '.json', '.tag']
})
*/
function resolve__rollup(options) {
return {
name: 'resolve__rollup',
View Main.html
<div class="jumbotron">
<div class="row">
<div class="col-md-6">
<h1>Svelte (keyed)</h1>
</div>
<div class="col-md-6">
<div class="row">
<div class="col-sm-6 smallpad">
<button type="button" class="btn btn-primary btn-block" id="run" on:click="run()">Create 1,000 rows</button>
</div>
@btakita
btakita / webpack-buble-plugin.js
Last active Mar 7, 2018
BublePlugin for Webpack
View webpack-buble-plugin.js
class BublePlugin {
apply(compiler) {
compiler.plugin('emit', (compilation, callback) => {
compilation.chunks.forEach(chunk => {
chunk.files.forEach(function(filename) {
if (/\.js$/.test(filename)) {
const source = compilation.assets[filename].source()
, __buble = buble.transform(source)
compilation.assets[filename] = {
source() {
View agent-example.js
agent__xyz(ctx).on('change', (ctx) => {
const {x,y,z} = ctx
})
agent__a(ctx).set({a:1})
function agent__xyz(ctx) {
let agent = ctx.agent__xyz
if (agent) return agent
return ensure__agent(ctx, {
key: 'agent__xyz',
scope: ['x', 'y', 'z'],
View Dossier__Search.html
<div class="Dossier__Search">
<input type="text" bind:value="query__search"/>
<ul class="search__people" class="{{class__search__people}}">
{{#each search__people as person}}
<li on:click="click__search__person(event, person)">
{{person.name}}
</li>
{{/each}}
</ul>
You can’t perform that action at this time.