poetry new <project-name>poetry add <library>| import React from 'react'; | |
| import useFeatureFlag from './useFeatureFlag'; | |
| import RecommendationsComponent from './Recommendations.js'; | |
| const { | |
| DecoratedComponent: Recommendations, | |
| featureEnabled: recommendationsFeatureEnabled, | |
| FeatureFlag | |
| } = useFeatureFlag({ | |
| Component: RecommendationsComponent, |
| 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, |
| FROM node:10-alpine as build | |
| WORKDIR /usr/src/app | |
| COPY package.json . | |
| COPY yarn.lock . | |
| COPY packages/shared ./packages/shared | |
| COPY packages/api ./packages/api | |
| RUN yarn install --pure-lockfile --non-interactive |
| #!/usr/bin/env bash | |
| function clear-cache { | |
| versions=() | |
| while read -r line; do | |
| clean="$(echo ${line} | sed "s,$(printf '\033')\\[[0-9;]*[a-zA-Z],,g")" | |
| valid=$(echo "${clean}" | grep '^[^a-zA-Z]' | grep -v 'system' | sed 's/->//' | sed 's/\s.*v//') | |
| if [[ ! -z $valid ]]; then | |
| versions+=(${valid}) |
| stages: | |
| - build | |
| - test | |
| - deploy | |
| variables: | |
| # from https://storage.googleapis.com/kubernetes-release/release/stable.txt | |
| K8S_STABLE_VERSION_URL: https://storage.googleapis.com/kubernetes-release/release/v1.10.4/bin/linux/amd64/kubectl | |
| build: |
| import click | |
| import hashlib | |
| import requests | |
| from pathlib import Path | |
| from tqdm import tqdm | |
| CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) |
init.rc changes to run any script Can be used to start any android application, service
on property:dev.bootcomplete=1
exec - system system -- /system/bin/sh <custom script path>
# exec - system system -- /system/bin/sh /data/local/bootscript/testservice.sh
Script can contains applications start, stop commands
I needed to quickly encode a protobuf from the command-line, and while I pretty much immediately came across protoc --encode as the obvious solution, I did not find much documentation on the input textual syntax.
Here is the relevant snippet from protoc --help:
--encode=MESSAGE_TYPE Read a text-format message of the given type
from standard input and write it in binary
to standard output. The message type must
be defined in PROTO_FILES or their imports.
| *** Cluster Setup for Google Container Engine *** | |
| 0/ Install and configure local gcloud and kubectl: https://cloud.google.com/sdk/docs/ | |
| > gcloud components install kubectl | |
| 1/ Configure Google Cloud account: | |
| > gcloud config set account YOUR_EMAIL_ADDRESS | |
| > gcloud config set project YOUR_PROJECT_ID | |
| > gcloud config set compute/zone us-west1-a | |
| > gcloud config set container/cluster example |