Skip to content

Instantly share code, notes, and snippets.

View baryon's full-sized avatar
💭
Founder of ChainBow

LI Long baryon

💭
Founder of ChainBow
View GitHub Profile
@baryon
baryon / YUICompress
Created October 28, 2011 02:17
YUICompress for BBEdit 10
#!/usr/bin/env python2.7
"""
YUICompress for BBEdit 10
A quick script to install into your `~/Library/Application Support/BBEdit/Scripts` folder.
This runs yuicompressor (requires yuicompressor to be installed at `/usr/local/bin` -
try ``/usr/bin/easy_install yuicompressor``)
How it works
1.Copy this script to a new file named 'YUICompress' and install the plugin.
@baryon
baryon / gist:11246286
Last active August 29, 2015 14:00 — forked from adamgit/gist:3705459
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.7
#
# Latest Change:
# - Supports iPhone 5 / iPod Touch 5 (uses Apple's workaround to lipo bug)
#
# Purpose:
@baryon
baryon / ss.yml
Last active November 26, 2023 04:27
在海外翻墙回国听音乐。IOS版Wingy使用的自定义配置YAML
adapter:
#ss代理, 在国内购买一台云服务器,安装好ShadowSocks代理服务器,iPhone版安装Wingy APP (SMART LIMITED的深蓝紫色免费版)。使用的本文的自定义配置YAML
- id: proxyAdapter
type: ss
#修改ss_host为服务器地址
host: ss_host
#修改ss_port为端口号
port: ss_port
#修改ss_password为密码
password: ss_password
@baryon
baryon / ss2.yml
Last active August 22, 2022 18:48
翻墙回国听音乐+屏蔽广告
adapter:
#ss代理, 在国内购买一台云服务器,安装好ShadowSocks代理服务器,iPhone版安装Wingy APP (SMART LIMITED的深蓝紫色免费版)。使用的本文的自定义配置YAML
- id: proxyAdapter
type: ss
#修改ss_host为服务器地址
host: ss_host
#修改ss_port为端口号
port: ss_port
#修改ss_password为密码
password: ss_password
{"sig":"53a00b60a3ce616e9608d6f9dbb05f50c20ffa5cbd95d35933e9fd514e683be5577af7a730ca1046220fd40e0f495036b32d64c25b2584399f9a739d96b76bc10","msghash":"5d0ce7f63dca01f074c1ae9c9e5626b9a245edcb5d6cd818694b182c1d919575"}
@baryon
baryon / nginx-dev-ssl.md
Last active March 11, 2022 08:45 — forked from LeZuse/nginx-dev-ssl.sh
配合nginx在本地开发https后端服务器

在开发后端服务时, APP中已经写好了服务器地址, 如何在本地开发机器调试呢? 首先,需要设置本地机器的hosts。 最方便的工具是gas masks https://github.com/2ndalpha/gasmask

添加类似如下代码

127.0.0.1		dev.example.com

生成本地证书 copy default OpenSSL config

@baryon
baryon / blockchain.js
Last active January 2, 2019 10:17
A blockchain demo
const tracer = require('tracer').colorConsole()
const console = tracer
const bitcoin = require('bsv')
const maxTried = 100000//Number.MAX_VALUE
class Block {
constructor(data, previousHash, difficulty) {
this.data = data.toString()
this.previousHash = previousHash
this.timestamp = Date.now().toString()
@baryon
baryon / CopyableLabel.swift
Created February 28, 2019 06:53
CopyableLabel
// Original Source:
// https://stackoverflow.com/questions/1246198/show-iphone-cut-copy-paste-menu-on-uilabel
class CopyableLabel: UILabel {
override init(frame: CGRect) {
super.init(frame: frame)
self.sharedInit()
}
@baryon
baryon / css_bdr.sol
Created September 6, 2019 10:18
CSS代币合约
/**
*Submitted for verification at Etherscan.io on 2019-09-06
*/
pragma solidity 0.5.4;
library SafeMath {
uint256 constant internal MAX_UINT = 2 ** 256 - 1; // max uint256
@baryon
baryon / cfs.sol
Created September 6, 2019 10:20
CFS股权合约
/**
*Submitted for verification at Etherscan.io on 2019-09-06
*/
pragma solidity 0.5.4;
library SafeMath {
uint256 constant internal MAX_UINT = 2 ** 256 - 1; // max uint256