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'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| title: 'Flutter Demo', | |
| debugShowCheckedModeBanner: false, |
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'; | |
| void main() { | |
| runApp( | |
| MaterialApp( | |
| home: HomeScreen(), | |
| ), | |
| ); | |
| } |
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'; | |
| @immutable | |
| class ShakeWidget extends StatelessWidget { | |
| final Duration duration; | |
| final double deltaX; | |
| final Widget child; | |
| final Curve curve; | |
| const ShakeWidget({ |
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:math'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/services.dart'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { |
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:flutter_redux/flutter_redux.dart'; | |
| import 'package:redux/redux.dart'; | |
| void main() => runApp(ExampleApp()); | |
| // <framework-specific part> | |
| typedef MetaBuilder<ViewModel> = Widget Function(ViewModelBuilder<ViewModel>); | |
| int counterReducer(int state, dynamic action) => | |
| state + (action is int ? action : 0); |
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
| // assuming the collection name is translations | |
| db.translations.find({_id: {$type: 7}}).forEach((r) => {const n = Object.assign({}, r, {_id: r._id.str}); db.translations.remove(r); db.translations.save(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
| cat > alice.js <<EOT | |
| var public = require('./public'); | |
| public.message = 'Hi Bob'; | |
| EOT | |
| cat > public.js <<EOT | |
| module.exports = {}; | |
| EOT | |
| cat > bob.js <<EOT | |
| var public = require('./public'); | |
| console.log(public.message); |
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
| function httpProxy($request, $upstream, Closure $callback = null) | |
| { | |
| $requestHeaders = $request['headers']; | |
| unset($requestHeaders['Host'], $requestHeaders['Connection']); | |
| $requestHeaders = stringifyHeaderPairs($requestHeaders); | |
| $ch = curl_init($upstream . $request['uri']); | |
| curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
| curl_setopt($ch, CURLOPT_VERBOSE, 1); | |
| curl_setopt($ch, CURLOPT_HEADER, 1); |
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
| устанавлиаваю npm пакеты, уже кучу установил, а потом при попыттке установить почти на любой пакет получаю ошибку gyp: /usr/share/node/common.gypi not found ... while reading includes of binding.gyp | |
| гуглю | |
| советуют установить sudo npm -g install node-gyp | |
| не помогает | |
| гуглю | |
| советуют обновиться | |
| не помогает | |
| гуглю | |
| советуют прописать пути | |
| не помогает |
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
| <?php | |
| class PHPUnitTest extends \PHPUnit_Framework_TestCase | |
| { | |
| /** | |
| * output of this test would be | |
| * <cite> | |
| * Failed asserting that 'cat does not have black fur' does not contain "cat does not have black fur". | |
| * </cite> | |
| * this is due to bad usage of PHPUnit_Framework_Constraint_Not::negate() |
NewerOlder