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
public class FragmentObserver extends Observable { | |
@Override | |
public void notifyObservers() { | |
setChanged(); // Set the changed flag to true, otherwise observers won't be notified. | |
super.notifyObservers(); | |
} | |
} |
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 java.util.regex.Pattern | |
def versionMajor = 1 | |
def versionMinor = 0 | |
def versionPatch = 0 | |
buildscript { | |
repositories { | |
mavenCentral() | |
} |
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:html'; | |
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
enum _DragState { | |
dragging, | |
notDragging, | |
} |
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
### Taken from https://github.com/Hyperparticle/hyperparticle.github.io/blob/2365749469b1eea3e8c4b18af24a4865fc426fd3/.circleci/config.yml | |
# Javascript Node CircleCI 2.0 configuration file | |
# | |
# Check https://circleci.com/docs/2.0/language-javascript/ for more details | |
# | |
version: 2 | |
jobs: | |
build: | |
docker: |
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
FROM google/dart AS dartc | |
WORKDIR /app | |
ADD pubspec.* /app/ | |
RUN pub get | |
ADD bin/ /app/bin/ | |
ADD lib/ /app/lib/ | |
RUN pub get --offline | |
RUN dart2aot /app/bin/main.dart /app/main.aot |
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
<string-array name="states"> | |
<item>AL</item> | |
<item>AR</item> | |
<item>AZ</item> | |
<item>CA</item> | |
<item>CO</item> | |
<item>CT</item> | |
<item>DE</item> | |
<item>DC</item> | |
<item>FL</item> |
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
public Bitmap blurBitmap(Bitmap bitmap){ | |
//Let's create an empty bitmap with the same size of the bitmap we want to blur | |
Bitmap outBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); | |
//Instantiate a new Renderscript | |
RenderScript rs = RenderScript.create(getApplicationContext()); | |
//Create an Intrinsic Blur Script using the Renderscript | |
ScriptIntrinsicBlur blurScript = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); |
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 python3 | |
''' | |
Get ./js_facade_gen, and ./three.js | |
Comment out ./three.js/src/renderers/shaders/UniformsUtils.d.ts to avoid errors | |
Navigate to js_facade_gen | |
Under Zsh, run: node index.js --base-path=../three.js --destination=../dart-threejs ../three.js/src/**/*.ts | |
Navigate to ../dart-threejs | |
Add pubspec.yaml with package:js | |
Run this script twice to add the needed Dart SDK imports |
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 _MyHomePageState extends State<MyHomePage> | |
with SingleTickerProviderStateMixin { | |
TabController _tabController; | |
FocusScopeNode _node = FocusScopeNode(); /// <----------------- | |
@override | |
void initState() { | |
_tabController = TabController(length: 3, vsync: this); |
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
/** | |
* This script expects the global variables 'refresh_token' and 'firebase_api_key' to be set. 'firebase_api_key' can be found | |
* in the Firebase console under project settings then 'Web API Key'. | |
* 'refresh_token' as to be gathered from watching the network requests to https://securetoken.googleapis.com/v1/token from | |
* your Firebase app, look for the formdata values | |
* | |
* If all the data is found it makes a request to get a new token and sets a 'auth_jwt' environment variable and updates the | |
* global 'refresh_token'. | |
* | |
* Requests that need authentication should have a header with a key of 'Authentication' and value of '{{auth_jwt}}' |