- foo
- bar
- subbar
- subpar
- ook?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
// Run at: dartpad.dev/4cfeeb62db10d88de448c98f626c317d | |
// A stream | |
Stream<String> getWordStream({delay = 1}) async* { | |
for(int index = 0; index < words.length; index++) { | |
final word = await fetchWord(index, delay:delay); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:go_router/go_router.dart'; | |
// The data we display | |
class Family { | |
int id; | |
String name; | |
Family(this.id, this.name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# gem install 'heroku-api' | |
require 'rubygems' | |
require 'heroku-api' | |
ADDON=/memcache.*/ | |
api_key = `heroku auth:token` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first you need to do a one-time setup step to create an OAuth token: | |
# do this to create an app with your OAUTH token | |
# | |
# curl -u github-user-name:github-password -H "Content-Type: application/json" -X POST -d '{"scopes":["gist"], "note": "gist backup"}' \ | |
# https://api.github.com/authorizations | |
# | |
# export GIST_OAUTH_TOKEN=xxxxx <<- token retrieved from the curl | |
# | |
curl -H "Authorization: token `echo $GIST_OAUTH_TOKEN`" -H "Content-Type: application/json" -X GET https://api.github.com/gists | \ | |
perl -ne 'if (m/.*raw.*(https.*)".*/){ print "$1\n"; }' | \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppServerConfiguration | |
attr_accessor :port, :admin_password | |
end | |
class FooServerConfiguration | |
attr_accessor :moo; | |
end | |
class Configuration | |
attr_accessor :tail_logs, :max_connections, :admin_password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def counter(start=0, increment=1) | |
lambda do | |
val = start | |
start+=increment | |
val | |
end | |
end | |
result = counter(10,2) |