Skip to content

Instantly share code, notes, and snippets.

@compcon
compcon / pilot.txt
Created Apr 2, 2020
Scatter - Samadhi Pham (LL:2)
View pilot.txt
{"id":"1f9801c6-d124-434d-b6a1-cb9d7837420b","cloudID":"","cloudOwnerID":"495f90de-8b4e-469e-96a6-3a5f883ac0d6","lastCloudUpdate":"Thu Apr 02 2020 00:10:35 GMT-0700 (Pacific Daylight Time)","level":2,"callsign":"Scatter","name":"Samadhi Pham","player_name":"","status":"Active","text_appearance":"","notes":"","history":"","portrait":"","cloud_portrait":"","quirk":"","current_hp":7,"reserves":[],"orgs":[],"background":"OUTLAW","mechSkills":[2,0,2,0],"licenses":[{"id":"mf_pegasus","rank":2}],"skills":[{"id":"sk_survive","rank":1},{"id":"sk_act_unseen_or_unheard","rank":1},{"id":"sk_take_someone_out","rank":3},{"id":"sk_patch","rank":1}],"talents":[{"id":"t_tactician","rank":2},{"id":"t_gunslinger","rank":2},{"id":"t_crack_shot","rank":1}],"core_bonuses":[],"loadouts":[{"id":"0c97461d-408f-4ef1-9042-ad8757179e36","name":"Primary","armor":[{"id":"pg_mobility_hardsuit","destroyed":false,"uses":0,"cascading":false,"customDamageType":null}],"weapons":[{"id":"pg_heavy_signature","destroyed":false,"uses":0,"cascading":
@compcon
compcon / pilot.txt
Created Apr 2, 2020
Scatter - Samadhi Pham (LL:2)
View pilot.txt
{"id":"1f9801c6-d124-434d-b6a1-cb9d7837420b","cloudID":"","cloudOwnerID":"495f90de-8b4e-469e-96a6-3a5f883ac0d6","lastCloudUpdate":"","level":2,"callsign":"Scatter","name":"Samadhi Pham","player_name":"","status":"Active","text_appearance":"","notes":"","history":"","portrait":"","cloud_portrait":"","quirk":"","current_hp":7,"reserves":[],"orgs":[],"background":"OUTLAW","mechSkills":[2,0,2,0],"licenses":[{"id":"mf_pegasus","rank":2}],"skills":[{"id":"sk_survive","rank":1},{"id":"sk_act_unseen_or_unheard","rank":1},{"id":"sk_take_someone_out","rank":3},{"id":"sk_patch","rank":1}],"talents":[{"id":"t_tactician","rank":2},{"id":"t_gunslinger","rank":2},{"id":"t_crack_shot","rank":1}],"core_bonuses":[],"loadouts":[{"id":"0c97461d-408f-4ef1-9042-ad8757179e36","name":"Primary","armor":[{"id":"pg_mobility_hardsuit","destroyed":false,"uses":0,"cascading":false,"customDamageType":null}],"weapons":[{"id":"pg_heavy_signature","destroyed":false,"uses":0,"cascading":false,"customDamageType":null},{"id":"pg_light_signature"
@ruanbekker
ruanbekker / validate_github_signature_python.py
Created Apr 2, 2020
Validate Github Secret with Github Webhooks and API Gateway / Lambda
View validate_github_signature_python.py
# GITHUB_SECRET
# 'fhe3UdxahLO0Txs......'
# >>> event['body']
# 'eyJ6ZW4iOi.......'
# >>> event['headers']['X-Hub-Signature']
# 'sha1=2c887c74da271045b170d224................'
import hashlib
View MyIntentService.kt
class MyIntentService : IntentService("MyIntentService") {
override fun onHandleIntent(intent: Intent?) {
//此時已在背景執行緒了,可以開始耗時操作
}
override fun onDestroy() {
super.onDestroy()
}
}
View .swift
struct TheDropDelegate: DropDelegate {
@Binding var textText:String
func validateDrop(info: DropInfo) -> Bool {
return info.hasItemsConforming(to: ["public.utf8-plain-text"])
}
func dropEntered(info: DropInfo) {
print("drop entered")
}
func performDrop(info: DropInfo) -> Bool {
if let item = info.itemProviders(for: "public.utf8-plain-text").first {
View wifi_receiver.java
mWifiBroadcastReceiver = new BroadcastReceiver()
{
@Override public void onReceive(Context c, Intent intent)
{
try
{
// Your code here
}
catch (Throwable e)
{
View select.sh
#!/bin/bash
all_done=0
while (( !all_done )); do
options=("do-1" "do-2" "Quit")
select opt in "${options[@]}"
do
case $opt in
"do-1")
@IngIeoAndSpare
IngIeoAndSpare / convertPng.py
Created Apr 2, 2020
background add alpha layer and convert png image
View convertPng.py
import cv2
def transBg(self, img):
tmp = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
_,alpha = cv2.threshold(tmp,0,255,cv2.THRESH_BINARY)
b, g, r = cv2.split(img)
rgba = [b,g,r, alpha]
dst = cv2.merge(rgba,4)
return dst
View PublicInterface.swift
public final class PublicKeyPinner {
/// Stored public key hashes
private let hashes: [String]
public init(hashes: [String]) {
self.hashes = hashes
}
/// Validates an object used to evaluate trust's certificates by comparing their public key hashes
/// to the known, trused key hashes stored in the app.
@Klikplip
Klikplip / PY0101EN-3-1-Conditions.ipynb
Created Apr 2, 2020
Python - Condition and Branching
View PY0101EN-3-1-Conditions.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.