Skip to content

Instantly share code, notes, and snippets.

View teddichiiwa's full-sized avatar
🎖️
Focusing

Teddy teddichiiwa

🎖️
Focusing
View GitHub Profile
@teddichiiwa
teddichiiwa / .gitignore
Last active February 7, 2023 05:02
.gitignore for Dart/ Flutter project
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
@teddichiiwa
teddichiiwa / settings.json
Created January 23, 2023 14:30
FVM VSCode's settings.json
{
"dart.flutterSdkPath": ".fvm/flutter_sdk",
// Remove .fvm files from search
"search.exclude": {
"**/.fvm": true
},
// Remove from file watching
"files.watcherExclude": {
"**/.fvm": true
}
@teddichiiwa
teddichiiwa / curl.md
Created July 1, 2022 18:47 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

private Float readUsage() {
try {
RandomAccessFile reader = new RandomAccessFile("/proc/stat", "r");
String load = reader.readLine();
String[] toks = load.split(" ");
long idle1 = Long.parseLong(toks[5]);
long cpu1 = Long.parseLong(toks[2]) + Long.parseLong(toks[3]) + Long.parseLong(toks[4])
+ Long.parseLong(toks[6]) + Long.parseLong(toks[7]) + Long.parseLong(toks[8]);
@teddichiiwa
teddichiiwa / README.md
Created April 18, 2020 23:14 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@teddichiiwa
teddichiiwa / Storyboard+.swift
Created April 16, 2019 06:52
Coordinator Pattern with Storyboards
import UIKit
protocol StoryboardInstantiable: NSObjectProtocol {
associatedtype MyType
static var defaultFileName: String { get }
static func instantiateViewController(_ bundle: Bundle?) -> MyType
}
extension StoryboardInstantiable where Self: UIViewController {
static var defaultFileName: String {