Skip to content

Instantly share code, notes, and snippets.

叶神月vs.王启超 撕逼战全解

原文

####【Round 1】

叶神月:你南书记市长一锅端

典故1:原南京市委书记杨卫泽双规(政治)
典故2:原南京市长季建业被双规(政治)

var result = ~ function(str) {
// Define a DSL
var r = function(target, replace) {
str = str.replace(new RegExp(target, 'gi'), replace || target);
};
// Use the DSL
r('JavaScript');
r('gogle', 'Google');
@m13253
m13253 / preload.cpp
Last active September 8, 2017 06:38
Preload files into memory cache, for example IME database, in case you have a slow HDD.
#include <windows.h>
#include <string>
using namespace std::string_literals;
constexpr size_t buffer_size = 64*1024;
static char buffer[buffer_size];
static DWORD PrintString(HANDLE h_stdout, std::wstring const& string) {
DWORD count;
@rjstelling
rjstelling / cs_xproj_validate.sh
Last active October 9, 2019 12:05
SEE: https://github.com/rjstelling/Xcode-Project-Validate. A very simple shell script to read .xcodeproj files and check if there are issues with the CODE_SIGN_IDENTITY. Having multiple entries can cause build errors (especially when Archiving or command line building). Link to StackOverflow question answering some questions about when and why t…
# /bin/bash
#Usage: $ ./cs_xproj_validate.sh path/to/xcode/project/file/theproject.xcodeproj
#More info: http://stackoverflow.com/q/13962341/89035
PROJECT_FILE="$1/project.pbxproj"
PREVIOUS_LINE=-1
for LINE in `cat "$PROJECT_FILE" | grep -n CODE_SIGN_IDENTITY | grep -o -E '^([0-9]*)'`
@inntran
inntran / autounattend.xml
Last active August 17, 2020 14:33
Windows 10 1803 Clean Setup, sponsored apps will not be installed, Administrator is enabled.
<?xml version="1.0" encoding="utf-8"?>
<!-- UEFI & GPT, 64GB C drive, 160GB D drive, Administrator enabled with empty password -->
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<servicing></servicing>
<settings pass="windowsPE">
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DiskConfiguration>
<WillShowUI>OnError</WillShowUI>
<Disk wcm:action="add">
<CreatePartitions>

原文

新老用户都可能遇到陷阱。下面我们列出频繁出现的问题,以及如何解决。 在 Freenode IRC #nginx 频道,我们经常看到这些问题。

[TOC]

关于本指南

最常见的是有人试图从其他指南拷贝配置片段。并非所有的指南是错误的,但绝大部分是有问题的。

@mlouro
mlouro / gulpfile.js
Last active June 21, 2022 23:20
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
@aubricus
aubricus / License
Last active June 20, 2023 01:19
Python Progress Bar
Copyright 2020 Aubrey Taylor
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.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTH
@PatrickLang
PatrickLang / mikrotik-pxe.md
Last active August 11, 2023 08:59
Boot from Mikrotik router and install Windows

Using a Mikrotik router to boot and install Windows

Lately I've been using Mikrotik routers because they're cheap, powerful, and fast. Most of them have either a USB or MicroSD slot, so you can add enough space to store network boot images right on the router.

I got most of the tips needed from these two articles, and combined them into this step by step guide:

@smammy
smammy / macOS-IPv6-Tunnel-DNS-HOWTO.md
Created December 13, 2018 19:14
How to convince macOS to do IPv6 DNS lookups when your only IPv6 address is via a VPN or tunnel of some sort

This was a huge hassle to figure out, so I wrote up a little guide in hopes that others would find it helpful:

How to convince macOS to do IPv6 DNS lookups when your only IPv6 address is via a VPN or tunnel of some sort

The Problem

macOS's domain name resolver will only return IPv6 addresses (from AAAA records) when it thinks that you have a valid routable IPv6 address. For physical interfaces like Ethernet or Wi-Fi it's enough to set or be assigned an IPv6 address, but for tunnels (such as those using utun interfaces) there are some extra annoying steps that need to be taken to convince the system that yes, you indeed have an IPv6 address, and yes, you'd like to get IPv6 addresses back for DNS lookups.

I use wg-quick to establish a WireGuard tunnel between my laptop and a Linode virtual server. WireGuard uses a utun user-space tunnel device to make the connection. Here's how that device gets configured: