Skip to content

Instantly share code, notes, and snippets.

View 0x1306a94's full-sized avatar
😶
depressed

0x1306a94 0x1306a94

😶
depressed
  • 09:15 (UTC +08:00)
View GitHub Profile
@0x1306a94
0x1306a94 / go-tcp.go
Last active May 22, 2018 05:57
go-tcp
package main
import (
"bufio"
"bytes"
"encoding/binary"
"fmt"
"io"
"net"
"log"
@0x1306a94
0x1306a94 / extract_chromium_net_base _url_header.sh
Last active February 16, 2019 15:26
提取chromium net base url 模块相关头文件
#!/bin/sh
set -e
# $1 源码根目录
# $2 编译输出目录
# $3 模块名
# $4 头文件输出根目录
@0x1306a94
0x1306a94 / extract_chromium_net_static_library_and_dependencies_library.sh
Created February 16, 2019 15:29
提取chromium net 模块静态库以及依赖库
#!/bin/sh
set -e
# $1 编译输出目录
# $2 lib输出根目录
function print_usage_and_exit() {
echo "${0} [build_out_dir] [libs_out_dir]"
exit 1
@0x1306a94
0x1306a94 / code.js
Last active September 26, 2020 04:45
批量下载AcFun视频
system = require('system')
fs = require('fs');
var page = require('webpage').create();
page.settings.userAgent= 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36';
const address = system.args[1];
var count = parseInt(system.args[2])
var indexNumber = 1
var playList = []
import UIKit
class CodeTextField: UITextField, UITextFieldDelegate {
let codeLength: Int
var characterSize: CGSize
var characterSpacing: CGFloat
let textPreprocess: (String) -> String
let validCharacterSet: CharacterSet
@0x1306a94
0x1306a94 / Default.swift
Created July 16, 2021 00:08 — forked from onevcat/Default.swift
Sample code of using Default to decode a property to the default value
import UIKit
protocol DefaultValue {
associatedtype Value: Decodable
static var defaultValue: Value { get }
}
@propertyWrapper
struct Default<T: DefaultValue> {
var wrappedValue: T.Value
// A view that can flip between its "front" and "back" side.
//
// Animation implementation based on:
// Chris Eidhof, Keyframe animations <https://gist.github.com/chriseidhof/ea0e435197f550b195bb749f4777bbf7>
import SwiftUI
// MARK: - Chris's keyframe animation design
struct Keyframe<Data: Animatable> {
@0x1306a94
0x1306a94 / IRMaker.cpp
Created April 21, 2022 00:23 — forked from rainyx/IRMaker.cpp
Create IR code easily
//
// Created by rainyx on 2022/4/16.
//
#include "IRMaker.h"
using namespace llvm;
using namespace std;
static bool hasTerminator(BasicBlock *BB) {
@0x1306a94
0x1306a94 / pthread_test.c
Last active July 24, 2022 03:11
pthread test
//
// main.c
// testdadkajdkajf
//
// Created by king on 2022/7/22.
//
#include <pthread.h>
#include <setjmp.h>
#include <stdio.h>