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
# - * - coding: UTF-8 - * - | |
import re | |
import os | |
import os.path | |
import marshal | |
from mercurial import cmdutil, patch, revset | |
from mercurial.error import ParseError | |
from mercurial.node import bin, hex |
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
r=lambda s:s.replace("\\","\\\\").replace("\"","\\\"");a,b="r=lambda s:s.replace(\"\\\\\",\"\\\\\\\\\").replace(\"\\\"\",\"\\\\\\\"\");a,b=\"","\";print(a+r(a)+\"\\\",\\\"\"+r(b)+b)";print(a+r(a)+"\",\""+r(b)+b) |
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
<!DOCTYPE html> | |
<html lang="zh-TW"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Polyfill demo for tone mark positioning</title> | |
<style> | |
body { | |
-webkit-writing-mode: vertical-rl; | |
-ms-writing-mode: tb-rl; | |
writing-mode: vertical-rl; |
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 python3 | |
import sys as _sys | |
import json as _json | |
import base64 as _base64 | |
import logging as _logging | |
import mimetypes as _mimetypes | |
import urllib.parse as _url | |
import configparser as _configparser |
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
#include <iostream> | |
template<class T> | |
class Out | |
{ | |
private: | |
T& mValue; | |
public: | |
explicit Out(T& aValue) |
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/sh | |
files=$(hg status | awk '$1 == "?" && $2 ~ /\.(orig|rej)$/ { print $2 }') | |
echo "$files" | |
read -r -p "Remove these files? [y/N]" resp | |
case $resp in | |
[yY][eE][sS]|[yY]) | |
rm $files | |
;; | |
*) |
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 python3 | |
# - * - coding: UTF-8 - * - | |
import sys | |
import json | |
import concurrent.futures as futures | |
from pathlib import Path | |
from difflib import Differ | |
from urllib.request import urlopen |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char** argv) | |
{ | |
if (argc < 3) { | |
printf("usage: %s inputfile outputfile\n", argv[0]); | |
exit(2); | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <sys/wait.h> | |
#include <sys/types.h> | |
#include <sys/ptrace.h> | |
const char *name; | |
void usage() |
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 ruby | |
require "socket" | |
require "OpenSSL" | |
Group = OpenSSL::PKey::EC::Group.new("secp160k1") | |
def send(server, data) | |
puts ">>> #{data}" | |
server.puts data |