This file contains 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
require 'rubygems' | |
require 'nokogiri' | |
require 'httparty' | |
export = Nokogiri::XML(File.new(ARGV[0])) | |
export.root.xpath("//item/link").each do |node| | |
begin | |
# do this the hard way because no way to get final URI after redirects otherwise | |
request = HTTParty::Request.new(Net::HTTP::Head, node.text, {}) | |
response = request.perform |
This file contains 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:dom', prefix:'dom'); | |
#import('dart:html'); | |
main() { | |
dom.AudioContext audioContext = new dom.AudioContext(); | |
dom.AudioBufferSourceNode source = audioContext.createBufferSource(); | |
dom.AudioGainNode gainNode = audioContext.createGainNode(); | |
source.connect(gainNode, 0, 0); |
This file contains 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
console.log([...document.querySelectorAll('.active .card')].map(card => card.title.replace(" - Foil", "")).map(title => `1 ${title} (NEO)`).join("\n")) |
This file contains 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
// Copyright 2017 The Chromium Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
// Note: I'm not the original author, I'm sharing via Gist to make | |
// it easy for folks to check it out. Please email | |
// flutter-dev@googlegroups.com if you have questions about that. | |
// A simple "rough and ready" example of localizing a Flutter app. | |
// Spanish and English (locale language codes 'en' and 'es') are |
This file contains 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
HttpServer.bind('127.0.0.1', 8889) | |
.then((HttpServer server) { | |
var sc = new StreamController(); | |
sc.stream.transform(new WebSocketTransformer()).listen(handleWebSocket); | |
server.listen((HttpRequest request) { | |
if (request.uri.path == '/ws') { | |
sc.add(request); | |
} else if (request.uri.path == '/foo') { | |
request.response.addString('foo'); |
This file contains 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'; | |
import 'dart:math'; | |
/* | |
* Findings: | |
* streams can be single or broadcast, but not sure why the diff. | |
* can check if a stream is broadcast with isBroadcast | |
* StreamController make it easy to use a stream and send it events | |
*/ |
This file contains 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'; | |
@lazy | |
import 'big_lib.dart' as big show soManyFunctions; | |
const lazy = const DeferredLibrary('big', uri: 'big.js'); | |
void main() { | |
lazy.load().then((_) { | |
big.soManyFunctions(); |
This file contains 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
{ | |
"kind": "chromewebstore#license", | |
"id": "ejbknjbccnnccddiljheadjafeeagcan/https://www.google.com/accounts/o8/id?id\u003dAItOawlh_ZYIBQi-kNV-d3Rd8WIjQEBsLDh5LDQ", | |
"appId": "ejbknjbccnnccddiljheadjafeeagcan", | |
"userId": "https://www.google.com/accounts/o8/id?id\u003dAItOawlh_ZYIBQi-kNV-d3Rd8WIjQEBsLDh5LDQ", | |
"result": "YES", | |
"accessLevel": "FREE_TRIAL" | |
} |
This file contains 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
return new SingleChildScrollView( | |
child: new Container( | |
margin: const EdgeInsets.all(16.0), | |
child: new Row( | |
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
mainAxisSize: MainAxisSize.min, | |
children: <Widget>[ | |
new Expanded(child: new LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints){ |
This file contains 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 TutorialHome extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
// Scafold is a layout for the major material design widgets. | |
return new Scaffold( | |
appBar: new AppBar( | |
leading: new IconButton( | |
icon: new Icon(Icons.menu), | |
tooltip: 'Navigation menu', | |
onPressed: null, |
NewerOlder