Skip to content

Instantly share code, notes, and snippets.

View Hiyorimi's full-sized avatar
💎
The Open Network

Kir Malev Hiyorimi

💎
The Open Network
View GitHub Profile
@Hiyorimi
Hiyorimi / tag_updater.py
Created August 28, 2022 11:28
Daily Notes hashtag updater
#!/usr/bin/python3
import os
import datetime as dt
import glob
from typing import List
def get_date_from_filename(filename: str) -> dt.date:
print(filename)
date_string = filename.split('.md')[0][2:]
@Hiyorimi
Hiyorimi / submit.md
Last active July 22, 2021 10:44 — forked from tanaikech/submit.md
Create Folder Tree of Google Drive using Node.js and Python

Create Folder Tree of Google Drive using Node.js

This is a sample script for retrieving a folder tree using Node.js and Python. In this sample, you can set the top of folder for the folder tree. In generally, the folder tree is created by retrieving folders from the top folder in order. For example, when Google Apps Script is used, the script becomes like this. But when Drive API is used for this situation, if there are a lot of folders in the top folder, a lot of APIs are required to be called. So in this sample, I have tried to create the folder tree by a small number of API calls as possible.

In this sample, in order to be easy to understand the flow, I used Quickstart for Node.js. When you use this sample script, at first, please check the document of Quickstart. And I confirmed that this sample worked at googleapis v30.0.0.

Flow :

  1. Retrieve all folders in Goo
-- Demonstration on how Cohort Analysis is done. In order to do this we just need 2 tables:
-- auth_user (id, timestamp)
-- reaction_view (user_id, timestamp)
-- The below example use the following table names and fields, feel free to replace them with yours.
-- - auth_user (id, date_joined)
-- - reaction_view (user_id, created_at)
-- Demo: https://demo.holistics.io/queries/11118-buyer-cohort-retention-analysis
-- Forked from https://gist.github.com/nvquanghuy/bd0fda7b88e5b2fd8e46e047e391d25f
@Hiyorimi
Hiyorimi / apns.py
Last active January 15, 2023 15:40 — forked from alucard001/apns.py
Python3 Apple Push Notification HTTP/2 Example - Silent Push
"""
Use HTTP/2 send APNS Example main reference
===========================================
http://gobiko.com/blog/token-based-authentication-http2-example-apns/
Error 410 to detect uninstalls
==============================
https://leftshift.io/mobile-tracking-uninstalls-on-ios-and-android
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html#//apple_ref/doc/uid/TP40008194-CH11-SW1
void main() {
var example9Array = const ["a", "b"];
example9() {
for (int i = 0; i < example9Array.length; i++) {
print("Example9 for loop '${example9Array[i]}'");
}
var i = 0;
while (i < example9Array.length) {
print("Example9 while loop '${example9Array[i]}'");
i++;
@Hiyorimi
Hiyorimi / main.go
Created April 22, 2019 14:34
Simple go echo server
package main
import (
"flag"
"log"
"net"
)
func echoServer(c net.Conn) {
for {
@Hiyorimi
Hiyorimi / .zshrc
Last active December 12, 2019 21:27
My .zshrc
# Uncomment next and the last line to profile
# zmodload zsh/zprof
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:/usr/local/go/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
@Hiyorimi
Hiyorimi / main.go
Created February 7, 2019 12:15
GeoHashingResearch
package main
import (
"bufio"
"flag"
"fmt"
"io"
"log"
"os"
"strconv"
@Hiyorimi
Hiyorimi / handy_geo.py
Last active January 27, 2019 14:28 — forked from amites/center_geo.py
Center Geolocations
from math import cos, sin, asin, atan2, sqrt, radians, degrees
def _hsin(theta):
return pow(sin(theta/2), 2)
def distance(lat1, lon1, lat2, lon2):
"""
Calulates distance between two points set as 4 coordinates.
"""
# convert to radians
@Hiyorimi
Hiyorimi / utils.go
Created January 11, 2019 10:52
Minimal TCP testing server implementation
package main
import (
"bufio"
"errors"
"fmt"
"io"
"net"
"strings"
"time"