Skip to content

Instantly share code, notes, and snippets.

View mingsai's full-sized avatar
🎯
Focusing

Tommie N. Carter, Jr. mingsai

🎯
Focusing
View GitHub Profile
@mingsai
mingsai / markdown-to-pdf.txt
Created March 3, 2022 14:41 — forked from davisford/markdown-to-pdf.txt
Convert Markdown to PDF
$ brew install markdown htmldoc
$ markdown <file.md> | htmldoc --cont --headfootsize 8.0 --linkcolor blue --linkstyle plain --format pdf14 - > <file.pdf>
@mingsai
mingsai / pageview_with_dots.dart
Last active January 28, 2020 09:45 — forked from collinjackson/main.dart
PageView example with dots indicator
// Copyright 2017, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(new MyApp());
}
@mingsai
mingsai / commit-message-guidelines.md
Created December 28, 2019 15:08 — forked from robertpainsi/commit-message-guidelines.md
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@mingsai
mingsai / redux_example.dart
Created December 23, 2019 15:45 — forked from hillelcoren/main.dart
Enable/disable dark mode with Redux
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:redux/redux.dart';
void main() {
final store =
Store<AppState>(reducer, initialState: AppState(enableDarkMode: false));
runApp(MyApp(store: store));
}
import 'package:flutter/material.dart';
import 'dart:math' as math;
import 'dart:async';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@mingsai
mingsai / clapping_hands.dart
Last active December 4, 2019 21:38 — forked from Kartik1607/main.dart
Clapping Hands
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
@mingsai
mingsai / UIViewController+SwiftUI.swift
Created September 23, 2019 01:18 — forked from timothycosta/UIViewController+SwiftUI.swift
Using UIViewController via the SwiftUI Environment
//
// UIViewController+SwiftUI.swift
//
// Created by Timothy Costa on 2019/07/04.
// Copyright © 2019 timothycosta.com. All rights reserved.
//
import SwiftUI
struct ViewControllerHolder {
//--------------------------------------------------
// The SwiftUI Lab: Advanced SwiftUI Animations
// https://swiftui-lab.com/swiftui-animations-part1
// https://swiftui-lab.com/swiftui-animations-part2
//--------------------------------------------------
import SwiftUI
struct ContentView: View {
var body: some View {
@mingsai
mingsai / RSSFeed.swift
Created January 15, 2019 09:56 — forked from kharrison/RSSFeed.swift
Swift Decodable With Multiple Custom Dates
import Foundation
extension DateFormatter {
static let iso8601Full: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
formatter.calendar = Calendar(identifier: .iso8601)
formatter.timeZone = TimeZone(secondsFromGMT: 0)
formatter.locale = Locale(identifier: "en_US_POSIX")
return formatter
@mingsai
mingsai / firebase_detect_data.js
Created April 18, 2017 10:53 — forked from anantn/firebase_detect_data.js
Firebase: Detecting if data exists. This snippet detects if a user ID is already taken
function go() {
var userId = prompt('Username?', 'Guest');
checkIfUserExists(userId);
}
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users';
function userExistsCallback(userId, exists) {
if (exists) {
alert('user ' + userId + ' exists!');