Skip to content

Instantly share code, notes, and snippets.

View liufsd's full-sized avatar
🎯
Focusing

liupeng liufsd

🎯
Focusing
View GitHub Profile
@RitvikMandyam
RitvikMandyam / BUILD
Created May 19, 2021 04:10
MediaPipe Holistic Tracking for Android
# Copyright 2019 The MediaPipe Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
//
// ContentView.swift
// SwiftUI Chat
//
// Created by Nick Halavins on 6/7/19. Updated 10/11/19
// Copyright © 2019 AntiLand. All rights reserved.
//
import SwiftUI
@MathiasSeguy-Android2EE
MathiasSeguy-Android2EE / androidx_migration.py
Last active July 1, 2020 08:57
This python script will migrate your package to the AndroidX new package. Dec2018. [https://medium.com/@android2ee/simple-androidx-migration-with-python-4e354ba6c945]
# -*- coding: utf-8 -*-
# python
# script for multiple find/replace old android package with the ones of AndroidX new packaging.
import os,sys
from os import walk
inputDir = "../app/src/"
fileExtension = [".xml",".java",".kt"]
SSE3=1 SSSE3=1 SSE4_1=1 SAHF=1 AVX=1 FMA3=1 BMI1=1 BMI2=1 LZCNT=1 POPCNT=1 ATOM=0
Synopsis:
shell [options] [--shell] [<file>...]
d8 [options] [-e <string>] [--shell] [[--module] <file>...]
-e execute a string in V8
--shell run an interactive JavaScript shell
--module execute a file as a JavaScript module
Options:
@UmairSharif99
UmairSharif99 / DownloadAndSaveAudioFile.swift
Last active July 21, 2024 18:08
Function to download audio file from url and save it in documents directory
func downloadAndSaveAudioFile(_ audioFile: String, completion: @escaping (String) -> Void) {
//Create directory if not present
let paths = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.libraryDirectory, FileManager.SearchPathDomainMask.userDomainMask, true)
let documentDirectory = paths.first! as NSString
let soundDirPathString = documentDirectory.appendingPathComponent("Sounds")
do {
try FileManager.default.createDirectory(atPath: soundDirPathString, withIntermediateDirectories: true, attributes:nil)
print("directory created at \(soundDirPathString)")
@peterli888
peterli888 / core.deltaBaseCacheLimit=2g 错误
Last active March 16, 2024 01:55
编译 v8 错误 core.deltaBaseCacheLimit=2g
编译 v8 core.deltaBaseCacheLimit=2g 错误
修改 depot_tools/gclient_utils.py
return '512m'
@dominicthomas
dominicthomas / max_height_linear_layout.txt
Created December 8, 2016 12:23
Enables you to set a max height for a linear layout while also using wrap content.. this means the layout will be collapsable but also have height constraints!
public class MaxHeightLinearLayout extends LinearLayout {
private int maxHeightDp;
public MaxHeightLinearLayout(Context context) {
super(context);
}
public MaxHeightLinearLayout(Context context, AttributeSet attrs) {
super(context, attrs);
@tnhu
tnhu / excel_generator.py
Created April 22, 2016 20:38
Open and Edit an Excel template using Python's openpyxl library
from openpyxl import load_workbook
wb = load_workbook('template.xlsx')
# grab the active worksheet
ws = wb.active
# Data can be assigned directly to cells
ws['A2'] = 'Tom'
ws['B2'] = 30
@bendytree
bendytree / WKWebViewPanelManager.h
Created November 4, 2015 20:10
Easily show WKWebView alerts, prompts, and confirms
//
// WKWebViewPanelManager.h
//
// A few helpers to easily show WKWebView alerts, confirms, and prompts.
//
// Created by Joshua Wright<@bendytree> on 11/4/15.
//
// License: MIT
//
// Inspired by: https://github.com/ShingoFukuyama/WKWebViewTips
@suya55
suya55 / ij.sh
Last active June 21, 2017 14:28
Open a project in IntelliJ IDEA from your command line! Raw
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
wd=`pwd`
# Setup your working directory. Edit 'work' to your working directory.
working_dir=`ls -1d ~/work/$1 | head -n1`
# were we given a directory?
if [ -d "$1" ]; then