Skip to content

Instantly share code, notes, and snippets.

View dayaki's full-sized avatar
🏠
Working from home

Dayo Akinkuowo dayaki

🏠
Working from home
View GitHub Profile
@dayaki
dayaki / reset.js
Created July 21, 2022 13:22
Reset a variable daily
let myVar = 10;
function scheduleReset() {
// get current time
let reset = new Date();
// update the Hours, mins, secs to the 24th hour (which is when the next day starts)
reset.setHours(24, 0, 0, 0);
// calc amount of time until restart
let t = reset.getTime() - Date.now();
setTimeout(function() {
@dayaki
dayaki / index.js
Last active June 29, 2022 07:17
Blockli template file
import React from "react";
import { NativeModules } from "react-native";
const { RNCustomCode } = NativeModules;
// Import needed Blockli Blocks here
import {
initialize,
BlockliVideo,
} from "@blocklienterprise/blockli";
import config from "@src/build_config.json";
@dayaki
dayaki / mongoose_tips.js
Last active April 23, 2021 21:10
Mongoose Tips
// compare mongoose id
user._id.toString() === request.params.id
// comparing mongoose ids and strings
first._id.equals(another._id)
@dayaki
dayaki / home.html
Created November 29, 2019 21:01
paypal integration
<ion-header>
<ion-navbar>
<ion-title>High Wycombe Mosque</ion-title>
</ion-navbar>
</ion-header>
<ion-content class="page-home">
<p class="title">{{ islamicDate }}</p>
<ion-list class="home-list" *ngIf="prayerTimes !== null" no-margin>
<ion-item no-lines>
* Generate Icons and SplashScreen
https://github.com/bamlab/generator-rn-toolbox/blob/master/generators/assets/README.md
https://medium.com/@pqkluan/how-to-implement-splash-screen-in-react-native-navigation-ee2184a1a96
@dayaki
dayaki / React Native debug build with RNN
Created May 6, 2019 08:51
Building a debug apk with React Native Navigation
react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/src/main/assets/index.android.bundle --assets-dest ./android/app/src/main/res
cd android
./gradlew app:assembleDebug
@dayaki
dayaki / laravel
Created March 31, 2019 00:56
remove /public from laravel url
<IfModule mod_rewrite.c>
# Turn Off mod_dir Redirect For Existing Directories
DirectorySlash Off
# Rewrite For Public Folder
RewriteEngine on
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
@dayaki
dayaki / customFont
Created March 2, 2019 23:23
Use custom fonts in React Native
1. Put all your fonts in you React-Native project directory
`./assets/fonts/`
2. Add the following line in your package.json
```
"rnpm": {
"assets": ["./assets/fonts"]
}
```
@dayaki
dayaki / reload.ts
Created May 31, 2018 09:31
Reload screen in Ionic3+
// Use an Event to reload the page
this.events.subscribe('reloadPage', () => {
console.log('app reloaded');
let component = this.navCtrl.getActive().instance;
// call component.ionViewDidLoad() inside whatever data you are refreshing with
// ionViewDidLoad() {} should be where you house your setup code
this.storage.set('garage', newData).then(() => {
component.ionViewDidLoad();
});
// uncomment this if it still didnt work