Skip to content

Instantly share code, notes, and snippets.

<?php
echo round(microtime(true) * 1000);
@manniru
manniru / pf.conf
Created July 11, 2020 10:16 — forked from ottodevs/pf.conf
Trustin's /etc/pf.conf for Mac OS X
# 1. Put this file to /etc/pf.conf
# 2. Install init boot scripts using IceFloor then - http://www.hanynet.com/icefloor/
# I tried to use IceFloor to configure everything but it didn't work very well.
# 3. Once done, you can confirm the rules were loaded with 'sudo pfctl -sr'
# 4. At System Preferences -> Security -> Firewall -> Firewall Options,
# check 'Block all incoming connections' to prevent annoying per-app dialogs.
set skip on lo0
set block-policy drop
@proxium
proxium / Whatsapp-Android-To-iOS-Importer.md
Last active May 1, 2024 12:23
How do I transfer WhatsApp from Android to iOS without phone rooting? [verified method 24-Oct-2020]

Initially based on https://github.com/residentsummer/watoi

Migrate Whatsapp chats history from Android to iOS.

Caveats

Media files and shared locations are not imported (got placeholders instead)

Messages from contacts that changed ids (phone numbers) are not linked

LEFT(FROM_UNIXTIME(created/1000),19)
select SUBSTRING(date from 1 for 7) as `month`, count(credit) as counts, round(sum(credit), 2) as total from __bank where type = 'bank_others' group by SUBSTRING(date from 1 for 7) WITH ROLLUP
"emulators": {
"functions": {
"port": 5001,
"host": "0.0.0.0"
},
"firestore": {
"port": 8080
},
"database": {
"port": 9000,
<form action="https://login.remita.net/remita/ecomm/finalize.reg" name="SubmitRemitaForm" method="POST">
<input name="merchantId" value="20842440353" type="hidden">
<input name="hash" value="83f604ae17ebe70faa1e77a7ac900d36e79a5a8415c0b19fbc8635cdd35f5a124f49748d1c9825718632a90d37eb7ae6e71d3159500fed2a1319151cfcfdccee" type="hidden">
<input name="rrr" value="280238454675" type="hidden">
<input name="responseurl" value="https://firsmaritimevat.com/app/response.php" type="hidden">
<input type="submit" name="submit_btn" value="Pay Via Remita">
</form>
@manniru
manniru / futils.js
Created October 6, 2020 17:50
functional util 2
export const useFetch = (url, options) => {
const [response, setResponse] = React.useState(null);
useEffect(async () => {
const res = await fetch(url, options);
const json = await res.json();
setResponse(json);
});
return response;
}
@manniru
manniru / 1-standard.js
Created October 6, 2020 16:47 — forked from vladfr/1-standard.js
Use async/await and for..of in Cloud Firestore
// In a Firestore standard example, we quickly create a 'xmas tree' of nested stuff
// We use Promises directly: get().then(callback) and use snapshot.forEach() to iterate
let campaignsRef = db.collection('campaigns');
let activeCampaigns = campaignsRef.where('active', '==', true).select().get()
.then(snapshot => {
snapshot.forEach(campaign => {
console.log(campaign.id);
let allTasks = campaignsRef.doc(campaign.id).collection('tasks').get().then(
snapshot => {
snapshot.forEach(task => {
var date;
date = new Date();
date = date.getUTCFullYear() + '-' +
('00' + (date.getUTCMonth()+1)).slice(-2) + '-' +
('00' + date.getUTCDate()).slice(-2) + ' ' +
('00' + date.getUTCHours()).slice(-2) + ':' +
('00' + date.getUTCMinutes()).slice(-2) + ':' +
('00' + date.getUTCSeconds()).slice(-2);