Skip to content

Instantly share code, notes, and snippets.

View xhacker's full-sized avatar
🌀

柳东原 · Dongyuan Liu xhacker

🌀
View GitHub Profile
@xhacker
xhacker / emoji.plist
Last active October 26, 2023 15:59
/System/Library/LinguisticData/RequiredAssets_zh.bundle/AssetData/emoji.plist in OS X 10.11 Copyright (C) Apple Inc.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>0</key>
<dict>
<key>emoji</key>
<array>
<string>0⃣️</string>
</array>
@xhacker
xhacker / build-and-run-cpp-st3.md
Last active October 8, 2020 10:52
Build and run C++ file in Sublime Text 3

How to Install

  • Tools → Build System → New build system...
  • Paste the content below
{
    "cmd": ["g++ ${file} -o ${file_path}/${file_base_name} && echo 'Build Finished' && ${file_path}/${file_base_name}"],
    "shell" : true
}
  • Save as C++ Build and Run.sublime-build
NSArray *cascadeList = @[[UIFontDescriptor fontDescriptorWithName:@"Helvetica" size:20.0],
[UIFontDescriptor fontDescriptorWithName:@"PingFangTC-Regular" size:20.0]];
CTFontDescriptorRef descriptor = CTFontDescriptorCreateWithAttributes((CFDictionaryRef) @{(id)kCTFontCascadeListAttribute: cascadeList});
UIFont *font = (__bridge_transfer UIFont *) CTFontCreateWithFontDescriptor(descriptor, 20, NULL);
CFRelease(descriptor);
self.label.font = font;
self.label.text = @"Helvetica fallback 到 PingFangTC-Regular 汉体书写信息技术标准相容档案下载使用界面简单支援服务升级资讯专业制作创意空间快速无线上网";
@xhacker
xhacker / retinalize.sh
Created February 15, 2017 09:23
Convert image to a 2x image
retinalize() { convert -density 144 -units pixelsperinch "$1" "$1" }
@xhacker
xhacker / style.css
Last active February 4, 2017 15:17
Better style for Stash
body,
textarea {
font-family: -apple-system !important;
-webkit-font-smoothing: subpixel-antialiased !important;
}
pre,
code,
.line-number,
.blame,
@xhacker
xhacker / zjuwlan-crack.py
Last active December 21, 2015 20:29
ZJUWLAN Password
import requests
url = "https://net.zju.edu.cn/cgi-bin/srun_portal"
number_range = (0, 0)
if __name__ == "__main__":
for username in xrange(number_range[0], number_range[1]):
passwords = [username, "123456", "12345678"]
for password in passwords:
/*
Copyright (C) 2015 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
The application delegate class used to manage this sample.
*/
import UIKit
@xhacker
xhacker / UIAppearance+Swift.m
Created September 6, 2015 14:49
appearanceWhenContainedIn: for Swift
#import "UIAppearance+Swift.h"
@implementation UIView (UIViewAppearance_Swift)
+ (instancetype)swift_appearanceWhenContainedIn:(NSArray *)containerClasses
{
NSUInteger count = containerClasses.count;
NSAssert(count <= 10, @"The count of containers greater than 10 is not supported.");
return [self appearanceWhenContainedIn:
@xhacker
xhacker / migrate.py
Last active August 29, 2015 14:13
This script migrates Inboard beta library to Inboard App Store version library.
#!/usr/bin/env python
"""This script migrates Inboard beta library to Inboard App Store version
library."""
import sqlite3
import os
from os.path import expanduser
import subprocess
import shutil
@xhacker
xhacker / update-git-repos.sh
Created December 9, 2014 08:21
Update Git repos in directory
find . ! -path . -maxdepth 1 -type d -exec sh -c '(cd {} && pwd && git pull)' ';'