Skip to content

Instantly share code, notes, and snippets.

@lephuongbg
lephuongbg / bitbucket-highlight.user.js
Last active February 14, 2023 02:15
Bitbucket Highlighter User Script
// ==UserScript==
// @name Bitbucket Highlighter
// @namespace https://github.com/lephuongbg
// @version 0.11
// @description Stop-gap solution for highlighting bitbucket pull request
// @author You
// @match https://bitbucket.org/*
// @grant GM_addStyle
// @grant GM_getResourceText
// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/highlight.min.js
@fcharlie
fcharlie / profile.json
Last active December 18, 2022 20:38
My Windows Terminal profile.json
// This file was initially generated by Windows Terminal 0.11.1333.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// You can add more global application settings here.
@nerzhulart
nerzhulart / Windows Defender Exclusions for Developer.ps1
Last active April 29, 2024 09:22 — forked from dknoodle/Windows Defender Exclusions VS 2017.ps1
Adds Windows Defender exclusions for developers (Visual Studio, JetBrains Rider, IntellIJ Idea, Git, MsBuild, dotnet, mono etc.)
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add('C:\ProgramData\Microsoft\VisualStudio\Packages') > $null
$pathExclusions.Add('C:\Program Files (x86)\MSBuild') > $null
$pathExclusions.Add('C:\Program Files (x86)\Microsoft Visual Studio 14.0') > $null
@AssIstne
AssIstne / PcmToWavUtil.java
Created April 4, 2018 02:27
utils to convert pcm byte array to wav byte array
public class PcmToWavUtil {
/**
* @param pcmData pcm原始数据
* @param numChannels 声道设置, mono = 1, stereo = 2
* @param sampleRate 采样频率
* @param bitPerSample 单次数据长度, 例如8bits
* @return wav数据
*/
public static byte[] pcmToWav(byte[] pcmData, int numChannels, int sampleRate, int bitPerSample) {
@shenqihui
shenqihui / object_entries.js
Last active May 31, 2019 08:22
WXS 中遍历对象
// 文件名应该是 object_each.wxs , github 上没法识别,所以直接用 js 后缀,如果name 中含有 " 引号,那就洗洗睡吧,不适合这样的业务。
// 匹配 key 的 regex
var keyRe = getRegExp('"[^"]+":', 'img');
// 匹配 name 替换的 regex
var replaceRe = getRegExp('[":]', 'img');
var objectEntries = function (target) {
var entries = [];
var targetString = JSON.stringify(target);
@tonyseek
tonyseek / android-captive.sh
Last active April 2, 2024 02:49
Overrides the captive portal settings of Android in the People's Republic China mainland
#!/usr/bin/env sh
## I don't have any devices running Android OS now. These settings may have been outdated but I cannot verify it.
adb shell settings put global captive_portal_fallback_url http://g.cn/generate_204
adb shell settings put global captive_portal_http_url http://www.google.cn/generate_204
adb shell settings put global captive_portal_https_url https://www.google.cn/generate_204
adb shell settings put global captive_portal_other_fallback_urls http://www.qualcomm.cn/generate_204

微信小程序模块化开发实践

准备

@sadikaya
sadikaya / cmder-in-webstorm.md
Created November 28, 2016 06:52
Cmder inside Webstorm terminal
  1. Set an environment variable called CMDER_ROOT to your root Cmder folder (in my case C:\Program Files (x86)\Cmder). It seems to be important that this does not have quotes around it because they mess with concatenation in the init script.
  2. In your IntelliJ terminal settings, use "cmd" /k ""%CMDER_ROOT%\vendor\init.bat"" as the Shell path. The double-double-quotes are intentional, as they counteract the missing double quotes in the environment variable.
@jarretmoses
jarretmoses / React Native Clear Cache
Last active March 11, 2024 10:20
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache