This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| bold() { printf "\033[1m%s\033[0m\n" "$*"; } | |
| info() { printf "• %s\n" "$*"; } | |
| warn() { printf "\033[33m! %s\033[0m\n" "$*"; } | |
| err() { printf "\033[31m✗ %s\033[0m\n" "$*" >&2; } | |
| ok() { printf "\033[32m✓ %s\033[0m\n" "$*"; } | |
| require_macos() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Function to display usage information | |
| usage() { | |
| echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]" | |
| exit 1 | |
| } | |
| # Check if at least one argument (input file) is provided | |
| if [ $# -lt 1 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct SmashableView: NSViewRepresentable { | |
| typealias NSViewType = _SmashableNSView | |
| let text: String | |
| class _SmashableNSView: NSView { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mp=1; size=7B; # to run 7B | |
| mp=8; size=65B; # to run 65B | |
| for seed in $(randint 1000000) | |
| do | |
| export TARGET_FOLDER=~/ml/data/llama/LLaMA | |
| time python3 -m torch.distributed.run --nproc_per_node $mp example.py --ckpt_dir $TARGET_FOLDER/$size --tokenizer_path $TARGET_FOLDER/tokenizer.model --seed $seed --max_seq_len 2048 --max_gen_len 2048 --count 0 | tee -a ${size}_startrek.txt | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "net" | |
| "net/http" | |
| "strings" | |
| ) | |
| type mux struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name 微信读书下载(已失效) | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.5.2 | |
| // @description 下载微信读书的书籍资源 | |
| // @author tang | |
| // @match https://weread.qq.com/web/reader/* | |
| // @grant unsafeWindow | |
| // @grant GM_setValue | |
| // @grant GM_getValue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @import Photos; | |
| [PHPhotoLibrary requestAuthorizationForAccessLevel:PHAccessLevelReadWrite handler:^(PHAuthorizationStatus status) { | |
| NSLog(@"PHAuthorizationStatus: %ld", status); | |
| PHFetchOptions *fetchOptions = [[PHFetchOptions alloc] init]; | |
| fetchOptions.includeHiddenAssets = YES; | |
| fetchOptions.includeAllBurstAssets = YES; | |
| PHFetchResult<PHAsset *> *result = [PHAsset fetchAssetsWithOptions:fetchOptions]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import onnx | |
| from onnx_tf.backend import prepare | |
| import tensorflow as tf | |
| import onnxruntime | |
| from PIL import Image | |
| import numpy as np | |
| import sys | |
| #You need to have model.onnx and neuralhash_128x96_seed1.dat in your working directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in | |
| all copies or substantial portions of the Software. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function isLeapYear(year: number) { | |
| return new Date(year, 1, 29).getDate() === 29 | |
| } | |
| export default isLeapYear |
NewerOlder