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 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return const MaterialApp( | |
title: 'AnimatedCrossFade demo', | |
home: DemoPage(), |
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
#! /usr/bin/env ruby | |
if Process.euid.nonzero? | |
$stderr.puts "Please run: sudo #{$0}" | |
exit 1 | |
end | |
PAM_PATH = "/etc/pam.d/sudo" | |
# The line to be inserted | |
LINE = "auth sufficient pam_tid.so" | |
# A regular expression that matches said line, plus whitespace variations |
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
void main() { | |
// Expected: -0:00:00.000123 | |
// Actual: 0:00:00.000123 | |
print(Duration(microseconds: -123)); | |
// Expected: -0:30:00.000000 | |
// Actual: 0:30:00.000000 | |
print(Duration(minutes: -30)); | |
// Expected: -1:00:00.000000 |
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
// Only invoke `graphql-codegen` if input files have been modified | |
const childProcess = require('child_process'); | |
const fs = require('fs'); | |
const glob = require('glob'); | |
const {safeLoad} = require('js-yaml') | |
function main() { | |
let args = process.argv.slice(2); | |
let configPath = args[args.indexOf('--config') + 1]; |
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
#!/bin/sh | |
set -ex | |
mkdir -p /tmp/repro-6074 | |
cd /tmp/repro-6074 | |
bundle env | |
# Bundler 1.15.4 | |
# Rubygems 2.6.13 | |
# Ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16] |
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
var re1 = /test/; | |
var re2 = new RegExp(re1); | |
assert(re1 !== re2, "new RegExp() should always return a new object"); | |
var scanner = /foo/g; | |
scanner.lastIndex = 3; | |
var copy = new RegExp(scanner); | |
assert(copy.lastIndex === 0, "new RegExp(...) should never copy lastIndex"); |
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
#! /usr/bin/env ruby1.9 | |
puts 1.upto(100).to_a.join("\n"). | |
gsub(%r{ | |
(?# matchers for multiples of 3 -- remainder=0,1,2 respectively) | |
(?<z>[0369]+(?:\g<u>\g<d>|\g<d>\g<u>)?|\g<u>\g<d>|\g<d>\g<u>){0} | |
(?<u>[147]\g<z>?|[258][0369]*\g<d>){0} | |
(?<d>[258]\g<z>?|[147][0369]*\g<u>){0} | |
(?# fizz/buzz matchers) | |
(?<fizz>\g<z>){0} |
NewerOlder