Skip to content

Instantly share code, notes, and snippets.

View aliafshar's full-sized avatar

Ali Afshar aliafshar

View GitHub Profile
ThemeData(
appBarTheme: AppBarTheme(
backgroundColor: Colors.white,
centerTitle: true,
titleTextStyle: TextStyle(
fontSize: 18,
color: Colors.black,
),
),
// ...
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData( //... ),
dev:
make serve &
watch -n 1 make build doc
doc: init
esdoc -c etc/esdoc_conf.json
build: init
rollup -c etc/rollup_conf.js
cp dist/yip.js docs/demo/
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="material.indigo-pink.min.css">
</head>
<body>
const appState = {
'message': 'hello'
}
// Register the component.
vue.component('my-awesome-component', {
template: '#myAwesomeComponent',
data: appState
});
@aliafshar
aliafshar / index.html
Last active December 6, 2016 10:04
Easy web components with Vue.js
<html>
<template id="myAwesomeComponent">
<h1>I am awesome</h1>
<p>You are awesome too.</p>
<p>{{ message }}</p>
</template>
<div id="myAwesomePage">
<my-awesome-component></my-awesome-component>
<article>
<meta name="title" content="my codelab" />
<meta name="description" content="something about my codelab">
<section title="Getting started">
My markdown *in* here.
</section>
# Create a connection
pubsub = Connection(PROJECT, credentials)
# Quick intro
# 1. publisher
topic = pubsub.create_topic('my-topic')
for i in range(100):
topic.publish('msg-{}'.format(i))
@aliafshar
aliafshar / gist:883b675ad8822eff6298
Created June 24, 2014 20:47
Some non-running code on async operations in compute
class Connection(object):
#...
def get_operation(self, operation, zone=None):
resp = self.svc.zoneOperations().get(**self._default_args(operation=operation,
zone=zone)).execute()
return Operation(raw=resp, connection=self)
def await_operation(self, operation, zone=None):
@aliafshar
aliafshar / gist:f014055896e02a197ab0
Last active August 29, 2015 14:02
where is your god now?
>>> import ctypes
>>> ctypes.c_int.from_address(id(True) + 16).value = 0
>>> True
False