Skip to content

Instantly share code, notes, and snippets.

View TJRoger's full-sized avatar
🎯
Focusing

Roger TJRoger

🎯
Focusing
View GitHub Profile
@TJRoger
TJRoger / ps.sh
Created September 14, 2016 07:35
#!/bin/bash
cd /home/
if [ $1 ]; then
for d in */ ; do
user=${d%/*}
echo $user;
#ps aux |grep router.php |grep $user |wc -l
ps aux |grep $1 |grep $user |wc -l
done
else
@TJRoger
TJRoger / gist:c62b5dfb6865ab66ea03
Created December 21, 2015 23:24 — forked from thinkphp/gist:1448754
Binary Search Tree Implementation in PHP
<?php
/**
* by Adrian Statescu <adrian@thinkphp.ro>
* Twitter: @thinkphp
* G+ : http://gplus.to/thinkphp
* MIT Style License
*/
@TJRoger
TJRoger / openssl-build.sh
Created December 8, 2015 15:26 — forked from felix-schwarz/openssl-build.sh
Updated script that builds OpenSSL for OS X, iOS and tvOS. Bitcode enabled for iOS, tvOS. Updated to build for tvOS, use the latest SDKs, skip installing man pages (to save time), download the OpenSSL source over HTTPS, patch OpenSSL for tvOS to not use fork(). Currently requires Xcode7.1b or later (for the tvOS SDK).
#!/bin/bash
# This script downloads and builds the iOS, tvOS and Mac openSSL libraries with Bitcode enabled
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
# https://gist.github.com/foozmeat/5154962
# Peter Steinberger, PSPDFKit GmbH, @steipete.
# Felix Schwarz, IOSPIRIT GmbH, @felix_schwarz.
@TJRoger
TJRoger / UITextView iOS 9.swift
Created October 14, 2015 09:47
show text from the top of UITextView in iOS 9
var workaroundIOS9Bug: Bool = true
override func viewDidLoad() {
super.viewDidLoad()
if #available(iOS 9.0, *) {
self.workaroundIOS9Bug = true
}else {
self.workaroundIOS9Bug = false
}
@TJRoger
TJRoger / webkit.md
Created September 5, 2015 18:13
Swift Script Error - Permission denied
./webkit.swift
-bash: ./webkit.swift: Permission denied

add x permision on it chmod +x webkit.swift

Keybase proof

I hereby claim:

  • I am tjroger on github.
  • I am tjroger (https://keybase.io/tjroger) on keybase.
  • I have a public key whose fingerprint is 99F8 BBB9 37C1 555B A489 DEF5 12F6 5302 1BBA 6B2A

To claim this, I am signing this object:

@TJRoger
TJRoger / keybase.md
Created September 1, 2015 18:06
keybase

Keybase proof

I hereby claim:

  • I am tjroger on github.
  • I am rogerluo (https://keybase.io/rogerluo) on keybase.
  • I have a public key whose fingerprint is 8BE0 968C 5A10 2B8E B2B1 12F6 D50B E371 BECE 1832

To claim this, I am signing this object:

@TJRoger
TJRoger / Donate Buttons.md
Last active August 9, 2016 16:37
Donate Buttons

PayPal donate button 支付宝捐助按钮

[![PayPal donate button](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=224D8E2ZAKV2A&item_name=node%2ddota2%2dspectator&currency_code=USD)
[![支付宝捐助按钮](https://img.shields.io/badge/%E6%94%AF%E4%BB%98%E5%AE%9D-%E5%90%91TA%E6%8D%90%E5%8A%A9-yellow.svg)](http://donate.rotk.tk)  

code for donate page

<form id="alipayForm" style="text-align:center" "onsubmit="document.charset='gbk';" accept-charset="GBK"  action="https://shenghuo.alipay.com/send/payment/fill.htm" method="post">
var finished = true;
var onFriendsMessage = function onFriendsMessage(source, message, type, chatter){
// respond to both chat room and private messages
if (type == 1) //1, message; 2, tying
if(friends.personaStates[source] != undefined){
console.log('Received message: \'' +message+'\' from '+friends.personaStates[source].player_name);
if(finished){
var rl = require('readline').createInterface({
input: process.stdin,