Skip to content

Instantly share code, notes, and snippets.

View laurivers's full-sized avatar
🏠
Working from home

Rivers laurivers

🏠
Working from home
  • 15:30 (UTC +09:00)
View GitHub Profile
public struct BoundedSequence<Base>: Sequence, IteratorProtocol where Base: Sequence {
public struct Boundary: Equatable {
public let isStart: Bool
public let isEnd: Bool
}
private var _iterator: Base.Iterator
private var _previous: Base.Element?
private var _current: Base.Element?
private var _next: Base.Element?
@laurivers
laurivers / xcode-beta-slink.sh
Last active June 16, 2019 05:56 — forked from ethanhuang13/xcode-beta-slink.sh
Symbolic link from Xcode to Xcode 10 beta 4 (10L221o)
@laurivers
laurivers / syncDoubanToGoodreads.js
Created December 31, 2015 07:28
Sync douban to goodreads
isReading = false;
isWishing = false;
isRead = false;
xmlHttp = new XMLHttpRequest();
trySyncGoodReads();
state = document.getElementsByClassName("mr10")[0];
if (state == undefined)
{
@laurivers
laurivers / NSDateFormatter cheat sheet
Created December 30, 2015 09:22 — forked from romaonthego/NSDateFormatter cheat sheet
Date Formats for NSDateFormatter
a: AM/PM
A: 0~86399999 (Millisecond of Day)
c/cc: 1~7 (Day of Week)
ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat
cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday
d: 1~31 (0 padded Day of Month)
D: 1~366 (0 padded Day of Year)
@laurivers
laurivers / pac.php
Created October 28, 2013 04:01 — forked from ratazzi/pac.php
<?php
/**
* 用于 Mac OS X 系统的 Automatic Proxy Configuration
* 因为 Firefox,Chrome 需要使用 SOCKS5 而 Safari 及其他程序只认 SOCKS,所以这样区分
* 也可以简单的使用 return "SOCKS5 127.0.0.1:7777;SOCKS 127.0.0.1:7777"; 这种方式
*/
$proxy = 'SOCKS';
$matches = array();
preg_match('/(Firefox|Chrome)/', $_SERVER['HTTP_USER_AGENT'], $matches);
if (!empty($matches)) {