Skip to content

Instantly share code, notes, and snippets.

@5lineofcode
5lineofcode / form.dart
Last active October 4, 2018 11:45
Form Implementation Example
/*
Output:
https://ibb.co/naw9te
*/
SearchInputRemote(
id: "kota_asal",
labelText: "Kota Asal",
iconName: Icons.search,
remoteApi: Tiket.getListCountry,
displayMember: "country_name",
@5lineofcode
5lineofcode / firebase.dart
Last active November 19, 2018 06:15
Firebase Flutter Script
getDataListen() {
CollectionReference reference = Firestore.instance.collection('jobs');
reference.snapshots().listen((querySnapshot) {
List<Joblist> todoList = List<Joblist>();
for (int i = 0; i < querySnapshot.documents.length; i++) {
todoList.add(Joblist.fromMap(querySnapshot.documents[i]));
}
setState(() {
joblist = todoList;
@5lineofcode
5lineofcode / view.dart
Created October 18, 2018 06:10
Extreme Action Button Example
//Buat terlebih dahulu UI-nya seperti berikut:
floatingActionButton: ExFloatingActionButton(
actionId: "sendMessage",
iconName: Icons.chat,
),
/*
Ok, selanjutnya definisikan actionnya sesuai actionId,
Best practices-nya, diletakkan di file terpisah namun tetap berfungsi jika diletakkan di file
yang sama
@5lineofcode
5lineofcode / firebase_cloud.js
Created October 29, 2018 19:59
Firebase Cloud Function send FCM Message
const payload = {
notification:{
title : 'Message from Cloud',
body : 'pesan',
badge : '1',
sound : 'default'
}
};
const token = "ekfw7H8sXcY:APA91bEKH2w-4228aeAh1gvTzt5f77i2lWEVyUgt2AUgw8Y75KOXuOUdm-m2Px9VPJEzMqvz_EY4wwSEB5gW9M0IdqzDWeMW7e92rO7iC_LQdVOSp_is7e75LT8H4Q7e-a3XwX8SgqLE";
return admin.messaging().sendToDevice(token,payload);
@5lineofcode
5lineofcode / form_element.dart
Last active November 4, 2018 19:09
form_element
/*
StandartInput
Rule:
ID dan labelText WAJIB di isi
*/
/*
Polos
*/
StandartInput(
@5lineofcode
5lineofcode / web.php
Created May 7, 2019 10:26
Router Dasar Laravel
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
@5lineofcode
5lineofcode / flutter.dart
Created May 9, 2019 09:32
Flutter Fix : Unable to find included file "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===
ç Files/Pods-Runner/Pods-Runner.release.xcconfig"
Release.xcconfig line 1: Unable to find included file "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
Code Signing Error: No profiles for 'com.example.flutterUikit' were found: Xcode couldn't find any iOS App Development
provisioning profiles matching 'com.example.flutterUikit'. Automatic signing is disabled and unable to generate a profile.
To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 12.1'
Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 12.1'
On IOS Directory, run this command:
@5lineofcode
5lineofcode / web.php
Created May 13, 2019 22:32
Auto Chmod777 Route
Route::get("fix",function(){
$result = system("cd .. && chmod 777 . -R");
echo $result;
});
@5lineofcode
5lineofcode / resize.sh
Last active November 21, 2019 02:37
Autoresize Image for AppStore
rm -rf ./6.5/
mkdir ./6.5
rm -rf ./5.5/
mkdir ./5.5
rm -rf ./12.9/
mkdir ./12.9
sips -z 1242 2688 *.png --out ./6.5
@5lineofcode
5lineofcode / resize_video.sh
Last active December 11, 2019 02:26
Autoresize Video for AppStore
INPUT_VIDEO=app_preview.mov
mkdir -p 6.5
mkdir -p 5.5
mkdir -p 12.9
WIDTH=886
HEIGHT=1920
OUTPUT_VIDEO=6.5/app_preview.mov
rm -f $OUTPUT_VIDEO