Instantly share code, notes, and snippets.

View createml.swift
import Cocoa
import CreateML
let 双色球神算子 = try MLTextClassifier(trainingData: [
"中奖啦": [
"09 11 14 20 27 30 09",
"02 09 14 15 16 23 10",
"11 16 19 22 25 30 08",
"02 05 06 13 16 19 03",
"04 09 15 16 19 27 10",
View CandleChart.swift
import UIKit
import PlaygroundSupport
let chartData: [Double] = [1, 2, 4, 0, 0, 2, 6, 0, 4, 8, 12, 14, 1, 2, 2, 0, 0, 1, 6, 0, 4, 0, 3, 0]
class TimelineCandleChart: UIView {
var data: [Double] = [] {
didSet { setNeedsDisplay() }
}
View RxTextFieldDelegateProxy.swift
//
// RxTextFieldDelegateProxy.swift
//
// Created by Lex Tang on 2/14/18.
// Copyright © 2018 Krunoslav Zaher. All rights reserved.
//
import RxSwift
import RxCocoa
View config.txt
"pool_list" :
[
{"pool_address" : "monerohash.com:5555", "wallet_address" : "48m3umQuRFHg1gFn7gucmuCkJLjHYq3QhjLB9i9XwWtoJfRpCiuxeW2UxAVXfvAGvJNa5opPKjQJock61uc2GY2i3YBszHc", "pool_password" : "", "use_nicehash" : false, "use_tls" : false, "tls_fingerprint" : "", "pool_weight" : 1 },
],
"currency" : "monero",
"call_timeout" : 10,
"retry_time" : 30,
"giveup_limit" : 0,
"verbose_level" : 3,
"print_motd" : true,
View update_settings_version.sh
#!/bin/bash
PLISTBUDDY="/usr/libexec/PlistBuddy"
INFO_PLIST="$CODESIGNING_FOLDER_PATH/Info.plist"
SETTINGS_PLIST="$CODESIGNING_FOLDER_PATH/Settings.bundle/Root.plist"
VERSION_NUMBER="`$PLISTBUDDY -c \"Print CFBundleShortVersionString\" \"$INFO_PLIST\"`"
BUILD_NUMBER="`$PLISTBUDDY -c \"Print CFBundleVersion\" \"$INFO_PLIST\"`"
VERSION="Version $VERSION_NUMBER ($BUILD_NUMBER)"
GROUP_INDEX="`xmllint --xpath \"count(//array/dict)-1\" \"$SETTINGS_PLIST\"`"
$PLISTBUDDY -c "Set :PreferenceSpecifiers:$GROUP_INDEX:Title '$VERSION'" "$SETTINGS_PLIST"
View CollectionOperator.swift
import Foundation
enum CollectionOperator: String {
case avg
case count
case max
case min
case sum
View enable-von-forward-nat.sh
#
# https://roelant.net/2015/share-your-vpn-mac-el-capitan.html
sleep 15
#
/usr/sbin/sysctl -w net.inet.ip.fw.enable=1
/usr/sbin/sysctl -w net.inet.ip.forwarding=1
/usr/sbin/sysctl -w net.inet6.ip6.forwarding=1
pfctl -d
pfctl -f /Users/lex/Dropbox/openvpn/pf.conf -e
View enable_disqus_for_ghost_casper_theme.html
<script>
(function(disqusid) {
var d=document,sections=document.getElementsByTagName("section")
for(var i=0;i<sections.length;i++){
if(sections[i].className=='share'){
var div=d.createElement('div');
div.setAttribute('id','disqus_thread');
sections[i].parentNode.appendChild(div);
var s=d.createElement('script');
s.src='//'+disqusid+'.disqus.com/embed.js';
View BackgroundHint.m
//
// BackgroundHint.m
// Zus
//
// Created by Lex on 4/13/16.
// Copyright © 2016 lex.sh. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
View dnspod-ddns.py
#!/usr/bin/env python
# -*- coding=utf-8 -*-
# Author: 易思龙 <ixxoo.me@gmail.com>
# Create: 2015-09-05
import time
import json
import urllib
import urllib2