Skip to content

Instantly share code, notes, and snippets.

View CroMarmot's full-sized avatar
🐀

陈鼫RWHTYFZ CroMarmot

🐀
View GitHub Profile
@Victrid
Victrid / gitgraft.sh
Created August 29, 2022 17:09
Find which commit your no-git friend is working on and generate patches for attaching their works onto git tree.
#!/bin/bash
hash git 2>/dev/null || { echo >&2 "Required command 'git' is not installed. ( hmm... why are you using this? ) Aborting."; exit 1; }
hash realpath 2>/dev/null || { echo >&2 "Required command 'realpath' is not installed. Aborting."; exit 1; }
hash pwd 2>/dev/null || { echo >&2 "Required command 'pwd' is not installed. Aborting."; exit 1; }
hash cd 2>/dev/null || { echo >&2 "Required command 'cd' is not installed. Aborting."; exit 1; }
hash echo 2>/dev/null || { echo >&2 "Required command 'echo' is not installed. Aborting."; exit 1; }
hash mv 2>/dev/null || { echo >&2 "Required command 'mv' is not installed. Aborting."; exit 1; }
hash diff 2>/dev/null || { echo >&2 "Required command 'diff' is not installed. Aborting."; exit 1; }
hash diffstat 2>/dev/null || { echo >&2 "Required command 'diffstat' is not installed. Aborting."; exit 1; }
@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];
@hrgnz
hrgnz / pe709a.nb
Created November 30, 2020 17:04
pe709a.nb
In[]:= ClearAll["Global`*"];
AbsoluteTiming[
nmax = 24680;
modnum = 1020202009;
dp[0] = 1; dp[1] = 1;
Do[dp[n + 1] =
Mod[PowerMod[n + 1, -1, modnum]*Sum[dp[2 k]*dp[n - 2 k],
{k, 0, Quotient[n, 2]}], modnum], {n, nmax - 1}];
ans = Mod[dp[nmax]*Mod[nmax!, modnum], modnum]]
/* So how does this work?
I'm using ANSI escape sequences to control the behavior of the terminal while
cat is outputting the text. I deliberately place these control sequences inside
comments so the C++ compiler doesn't try to treat them as code.*/
//
/*The commands in the fake code comment move the cursor to the left edge and
clear out the line, allowing the fake code to take the place of the real code.
And this explanation uses similar commands to wipe itself out too. */
//
#include <cstdio>
@PhotonQuantum
PhotonQuantum / elect_course_analysis.md
Last active July 11, 2023 16:11
正方教务(交大)选课协议分析

标记说明:

A 课程类型:主修、民族课、版块课(体育,英语)等,影响 rwlx xkly xkkz_id bklx_id kklxdm
B 个人及客观信息:学期号、专业号、选课学年等
C 特定课程及教学班信息
E 请求相关:分页参数

静态网页及相应查询参数准备

A1. 请求所有课程类型

@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active June 2, 2024 12:09
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@dagalti
dagalti / vue-material-swipe-tabs-with-animation.html
Last active April 12, 2024 02:29
Vuejs Material design tabs with swipe, transitions effects without using extra libraries.
<!---
1. Set Tabwidth in data
2. Tabs are swipeable
3. Scrollable tabs
4. No external libraries used expcept vuejs
5. Using vuejs transition for animation
Demo : https://dagalti.github.io/vue-tabs.html
Codepen : https://codepen.io/dagalti/pen/pYKXQW
-->
@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active May 29, 2024 07:29 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
<!doctype html>
<!-- This is just a very slightly modified tracking.js demo: https://trackingjs.com/examples/face_camera.html -->
<html>
<head>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/tracking.js/1.1.3/tracking-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tracking.js/1.1.3/data/face-min.js"></script>
<style>
video, canvas {
margin-left: 100px;
@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com