Skip to content

Instantly share code, notes, and snippets.

@lvxianchao
lvxianchao / npm.taobao.sh
Last active December 26, 2024 09:00
设置 npm 和 yarn 的镜像源为淘宝镜像源
# ==========================================================
# NPM
# ==========================================================
npm set registry https://registry.npmmirror.com # 注册模块镜像
npm set disturl https://npmmirror.com/mirrors/node # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://registry.npmmirror.com/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://registry.npmmirror.com/mirrors/electron/ # electron 二进制包镜像
@RaphaelWimmer
RaphaelWimmer / btw5-switch.py
Last active December 26, 2024 08:55
Switch Creative BT-W5 between AptX Adaptive Low Latency and High Quality modes
#!/usr/bin/env python3
# Simple tool to switch the Creative BT-W5 Bluetooth Audio dongle between AptX Adaptive **Low Latency** or **High Quality** mode.
# Of course, only works with Bluetooth headphones that support AptX Adaptive, such as the Tranya X3
# Reverse engineered based on communication between Creative's desktop app for Windows and the BT-W5.
# Might also accidentally overwrite other settings as a whole config data array is sent without taking into account the existing config.
#
# Usage: sudo ./btw5-switch.py ll (for low-latency mode)
# sudo ./btw5-switch.py hq (for high-quality mode)
#
@taylorza
taylorza / ctctest.asm
Last active December 26, 2024 08:54
ZX Spectrum Next Samples
SLDOPT COMMENT WPMEM, LOGPOINT, ASSERTION
DEVICE ZXSPECTRUMNEXT
CSPECTMAP "ctctest.map"
org $8000
ctc0 equ $183b
main:
nextreg 7,0 ; set speed
@thachpham92
thachpham92 / gist:d57b18cf02e3550acdb5
Last active December 26, 2024 08:51
Tất cả các tham số trong WP_Query
// Source: https://gist.github.com/luetkemj/2023628
// Xem hướng dẫn WP_Query toàn tập: http://goo.gl/kRpzTz
<?php
$args = array(
//////Author Parameters - Tham số lấy bài viết theo tác giả
//http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters
'author' => '1,2,3,', //(int) - Các ID tác giả cần lấy bài viết (thêm dấu - vào để loại trừ tác giả, ví dụ: -14, -20)
'author_name' => 'luetkemj', //(string) - Lấy bài viết dựa theo tên nick name của tác giả
'author__in' => array( 2, 6 ), //(array) - Lấy bài dựa theo ID của tác giả
@mcortes19
mcortes19 / RADIUS.md
Last active December 26, 2024 08:47
Set up RADIUS server with local, mysql and LDAP configuration

RADIUS SERVER

ROUTER/AP SETTINGS

  • SSID = redes
  • IP = 192.168.1.1/24
  • SECURITY MODE = WPA2 Enterprise
  • RADIUS SERVER = 192.168.1.254
@bluewalk
bluewalk / GetNordVPNWireGuardDetails.md
Last active December 26, 2024 08:44
Getting NordVPN WireGuard details

About

Instructions to obtain WireGuard details of your NordVPN account. These can be used to setup a WireGuard tunnel on your router to NordVPN.

Source: https://forum.gl-inet.com/t/configure-wireguard-client-to-connect-to-nordvpn-servers/10422/27

Prerequisites

If you have any linux machine, use that or install a vm if you don't have one.

Get their official linux app installed. Make sure you have wireguard installed too. And set the used technology to Nordlynx by running nordvpn set technology nordlynx

@krzys-h
krzys-h / SaveRenderTextureToFile.cs
Last active December 26, 2024 08:44
[Unity] Save RenderTexture to image file
using UnityEngine;
using UnityEditor;
public class SaveRenderTextureToFile {
[MenuItem("Assets/Save RenderTexture to file")]
public static void SaveRTToFile()
{
RenderTexture rt = Selection.activeObject as RenderTexture;
RenderTexture.active = rt;
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active December 26, 2024 08:43
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
import requests
from sys import argv
from re import compile
BASE = 'https://awbw.amarriner.com/viewtournament.php?tournaments_id='
r = requests.get(BASE + argv[1])
n = None
elos = []
for line in r.text.split("\n"):
@dale3h
dale3h / automations.yaml
Created May 15, 2019 04:45
[Home Assistant] Webhook Debugger
# Webhook URL: https://[your-hass-domain]/api/webhook/2qDFuSEBA7jU2sNjaK6JD5ac3FxnGfVTSF
- id: webhook_debugger
alias: "Webhook Debugger"
trigger:
- platform: webhook
webhook_id: 2qDFuSEBA7jU2sNjaK6JD5ac3FxnGfVTSF
action:
- service: persistent_notification.create
data_template: