abstract class BuildMode { | |
static final BuildModeType buildMode = () { | |
if (const bool.fromEnvironment('dart.vm.product')) { | |
return BuildModeType.release; | |
} | |
var result = BuildModeType.profile; | |
assert(() { | |
result = BuildModeType.debug; | |
return true; | |
}()); |
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
#include <stdio.h> | |
/* | |
* Calculates what Ada Lovelace labeled "B7", which today we would call the 8th | |
* Bernoulli number. | |
*/ | |
int main(int argc, char* argv[]) | |
{ | |
// ------------------------------------------------------------------------ | |
// Data |
A quick cheatsheet of useful snippet for Flutter
A widget is the basic type of controller in Flutter Material.
There are two type of basic Widget we can extend our classes: StatefulWidget
or StatelessWidget
.
StatefulWidget are all the widget that interally have a dynamic value that can change during usage. It can receive an input value in the constructor or reference to functions. You need to create two classes like:
import 'package:flutter/material.dart'; | |
import 'theme.dart' as Theme; | |
void main() { | |
runApp( | |
new MaterialApp( | |
title: 'CompanyApp', | |
color: Theme.CompanyColors.blue[500], | |
theme: Theme.CompanyThemeData, | |
home: new Scaffold( |
# Note: it is a copy of great answer by "mgoldwasser" from Stackoverflow | |
# Check the original answer here: http://stackoverflow.com/a/26018934/1032439 | |
# Imagine that post1, post5, and post1000 are posts objects with ids 1, 5 and 1000 respectively | |
# The goal is to "upsert" these posts. | |
# we initialize a dict which maps id to the post object | |
my_new_posts = {1: post1, 5: post5, 1000: post1000} | |
for each in posts.query.filter(posts.id.in_(my_new_posts.keys())).all(): |
[12:03 AM] acemarke: "controlled" and "uncontrolled" inputs
[12:04 AM] acemarke: if I have a plain, normal HTML page, and I put <input id="myTextbox" type="text" />
in my page(edited)
[12:04 AM] acemarke: and I start typing into that textbox
[12:04 AM] acemarke: it remembers what I've typed. The browser stores the current value for that input
[12:05 AM] acemarke: and then sometime later, I can get the actual element, say, const input = document.getElementById("myTextbox")
, and I can ask it for its value: const currentText = input.value;
[12:05 AM] acemarke: good so far?
[12:08 AM] acemarke: I'll keep going, and let me know if you have questions
[12:08 AM] lozio: ok, actually I'm reading
[12:09 AM] lozio: good
[12:09 AM] acemarke: so, a normal HTML input field effectively stores its own value at all times, and you can get the element and ask for its value
It gives notifications when someone goes online or offline or typing. Open chat of the contact you want to monitor and start script.
- Create a bookmark and Add the content of bookermarklet as url. (or goto http://parthpower.github.io/serviceworkers/whatsappmonitor.html)
- Goto whatsapp on web and click on the bookmark.
- Open chat of the contact you want to monitor.
package codepath.com.recyclerviewfun; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class Contact { | |
private String mName; | |
private boolean mOnline; | |
public Contact(String name, boolean online) { |