This file contains hidden or 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 ruby | |
require 'open3' | |
class KtlintPreCommitHook | |
def self.run | |
puts "Running pre commit hook" | |
check_ktlint_availability | |
files_needs_formatting = check_changed_files | |
auto_format_changed_files(files_needs_formatting) | |
end |
This file contains hidden or 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
#!/bin/bash | |
# This hook is based on https://medium.com/@nicklee1/prepending-your-git-commit-messages-with-user-story-ids-3bfea00eab5a | |
## HOW TO INSTALL | |
# GLOBAL FOR ALL FUTURE PROJECT | |
# git config --global init.templatedir '~/.git-templates' | |
# mkdir -p ~/.git-templates/hooks | |
# touch ~/.git-templates/hooks/prepare-commit-msg |
This file contains hidden or 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 'package:built_value/serializer.dart'; | |
import 'package:cloud_firestore/cloud_firestore.dart'; | |
class FirebaseTimestampSerializerPlugin implements SerializerPlugin { | |
@override | |
Object beforeSerialize(Object object, FullType specifiedType) { | |
if (object is DateTime && specifiedType.root == DateTime) | |
return object.toUtc(); //Timestamp.fromMicrosecondsSinceEpoch(object); | |
return object; | |
} |
This file contains hidden or 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
@Test | |
fun `someTest-which-should-test-diffrent-behavior-on-diffrent-sdk-version`() { | |
setSDK(Build.VERSION_CODES.N) | |
//some test | |
setSDK(Build.VERSION_CODES.M) | |
// some test again with diffrent SDK verion | |
} | |
This file contains hidden or 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 ruby | |
# | |
# Git commit-msg hook. If your branch name is in the form "ABCDE-1234567-postfix", or | |
# "ABCDE-1234567_postfix", it automatically adds the prefix "ABCDE-1234567 |" to commit | |
# messages. | |
# | |
# Example | |
# ======= | |
# | |
# git checkout -b ABCDE-1234567-some-cool-feature |
This file contains hidden or 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 ruby | |
# | |
# Git commit-msg hook. If your branch name is in the form "ABCDE-1234567-postfix", or | |
# "ABCDE-1234567_postfix", it automatically adds the prefix "ABCDE-1234567 |" to commit | |
# messages. | |
# | |
# Example | |
# ======= | |
# | |
# git checkout -b ABCDE-1234567-some-cool-feature |
This file contains hidden or 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 'package:bill_scanner/generated/i18n.dart'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( |
This file contains hidden or 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 IgnoreSSL { | |
static X509TrustManager doNotValidateTrustManager() { | |
// Create a trust manager that does not validate certificate chains | |
return new X509TrustManager() { | |
@Override | |
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) { | |
} | |
@Override |
This file contains hidden or 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
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | |
Context appContext = mWeakActivity.get().getApplicationContext(); | |
return FileProvider. | |
getUriForFile(appContext, appContext.getPackageName() + ".provider", file); | |
}else { | |
return Uri.fromFile(file); | |
} | |
-------------------------------- | |
Add to manifest |
NewerOlder