Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>HKAtrialFibrillationDetectionOnboardingCompleted</key>
<integer>1</integer>
<key>HKElectrocardiogramOnboardingCompleted</key>
<integer>3</integer>
</dict>
</plist>
@wasi0013
wasi0013 / download_large_file.py
Created October 4, 2019 13:35
how to download large file using python, requests without exhausting device ram.
import requests
chunk_size = 4096
filename = "logo.png"
document_url = "https://wasi0013.files.wordpress.com/2018/11/my_website_logo_half_circle_green-e1546027650125.png"
with requests.get(document_url, stream=True) as r:
with open(filename, 'wb') as f:
for chunk in r.iter_content(chunk_size):
if chunk:
f.write(chunk)
@alexcasalboni
alexcasalboni / lex.py
Created May 29, 2019 17:49
Amazon Lex fulfillment function - Lambda handler (Python) + utilities
import logging
from lex_utils import elicit_slot, delegate, close, ElicitAction, DelegateAction
from utils import validate_dialog, init_or_load_session, finalize_session, actually_book_the_hotel
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
def lambda_handler(event, context):
logger.debug('event.bot.name=%s', event['bot']['name'])
logger.debug('userId=%s, intentName=%s', event['userId'], event['currentIntent']['name'])
@liuguangw
liuguangw / make_cert.md
Last active June 3, 2024 10:39
使用openssl制作自定义CA、自签名ssl证书

自签名ssl证书生成

生成CA私钥

# 创建文件夹 ca 保存Ca相关
mkdir ca
cd ca
#创建私钥 (建议设置密码)
openssl genrsa -des3 -out myCA.key 2048
@CharlesHolbrow
CharlesHolbrow / ffmpeg-hls.html
Created September 13, 2018 22:44
Example of ffmpeg for live hls streaming with hls.js
<!DOCTYPE html>
<html lang='`en'>
<head>
<meta charset='utf-8'/>
<title>Audio only stream example</title>
<script src="//cdn.jsdelivr.net/npm/hls.js@latest"></script>
<style>
video {
width: 640px;
height: 360px;
@sumitsk20
sumitsk20 / uwgi-medium-post.ini
Last active January 30, 2024 07:58
uwsgi configuration with most commonly sused options for highly scalable website (medium blog post)
[uwsgi]
# telling user to execute file
uid = bunny
# telling group to execute file
gid = webapps
# name of project you during "django-admin startproject <name>"
project_name = updateMe
@SoarLin
SoarLin / firebase-messaging-sw.js
Created June 2, 2018 04:28
Firebase Messaging Service Worker JS
// [START initialize_firebase_in_sw]
// Import and configure the Firebase SDK
// These scripts are made available when the app is served or deployed on Firebase Hosting
// If you do not serve/host your project using Firebase Hosting see https://firebase.google.com/docs/web/setup
importScripts('https://www.gstatic.com/firebasejs/5.0.0/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/5.0.0/firebase-messaging.js');
firebase.initializeApp({
messagingSenderId: '<YOUR_SENDER_ID>'
});
const messaging = firebase.messaging();
<template>
<div>
...
<button @click="registeFCM">Register</button>
...
</div>
</template>
<script>
import 'firebase/messaging'
@SoarLin
SoarLin / vue_firebase_main.js
Created June 2, 2018 04:24
Vue Project use firebase cloud messaging
const FCMconfig = {
apiKey: 'YOUR_API_KEY',
authDomain: 'YOUR_DOMAIN',
databaseURL: 'https://<YOUR_PROJECT_ID>.firebaseio.com',
projectId: 'YOUR_PROJECT_ID',
storageBucket: '<YOUR_PROJECT_ID>.appspot.com',
messagingSenderId: 'YOUR_SENDER_ID'
}
firebase.initializeApp(FCMconfig)
@thomaspoignant
thomaspoignant / export_dokuwiki
Last active March 17, 2024 03:06
Dokuwiki, export all pages with one command line. The result is all the wiki pages and files in html
wget \
--recursive \
--no-clobber \
--page-requisites \
--no-check-certificate \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--no-parent \
--domains yourdomain.com \