To pupils: all binaries can be downloaded http://pan.baidu.com/s/1ntCChyp
After overwriting, maybe need to run chmod +x /path/to/sublime_text
. For linux default installation, need to add sudo
.
For programmers:
#!/usr/bin/env bash | |
# login as root and run this script via bash & curl: | |
apt-get update | |
apt-get install -y build-essential bison openssl libreadline5 libreadline-dev curl \ | |
git-core zlib1g zlib1g-dev libopenssl-ruby libcurl4-openssl-dev libssl-dev \ | |
libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev \ | |
mysql-client mysql-server |
#!/usr/bin/env bash | |
# login as root and run this script via bash & curl: | |
apt-get update | |
apt-get install -y build-essential bison openssl libreadline5 libreadline-dev curl \ | |
git-core zlib1g zlib1g-dev libopenssl-ruby libcurl4-openssl-dev libssl-dev \ | |
libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev \ | |
libyaml-dev libxslt1-dev autoconf libgdbm-dev libncurses5-dev automake libtool libffi-dev \ | |
mysql-client mysql-server |
//Here's the same thing in Objective-C | |
#import "WebView.h" | |
@implementation WebView | |
@synthesize webView = _webView; | |
-(void) viewDidLoad | |
{ |
//Here's the same thing in Objective-C | |
#import "WebView.h" | |
@implementation WebView | |
@synthesize webView = _webView; | |
-(void) viewDidLoad | |
{ |
# A simple example of creating a UIView with a UICollectionView as a subview | |
# in RubyMotion using Teacup for styling | |
# | |
# Your controller will need to set the stylesheet: stylesheet :example | |
# and create this view like so: subview Example, :my_example_view | |
class Example < UIView | |
CELL_IDENTIFIER = 'example_cell' | |
def initWithFrame(frame) |
app.info_plist['UIStatusBarStyle'] = 'UIStatusBarStyleBlackTranslucent' | |
app.info_plist["UIViewControllerBasedStatusBarAppearance"] = false |
extension NSAttributedString { | |
func replaceHTMLTag(tag: String, withAttributes attributes: [String: AnyObject]) -> NSAttributedString { | |
let openTag = "<\(tag)>" | |
let closeTag = "</\(tag)>" | |
let resultingText: NSMutableAttributedString = self.mutableCopy() as NSMutableAttributedString | |
while true { | |
let plainString = resultingText.string as NSString | |
let openTagRange = plainString.rangeOfString(openTag) | |
if openTagRange.length == 0 { |
To pupils: all binaries can be downloaded http://pan.baidu.com/s/1ntCChyp
After overwriting, maybe need to run chmod +x /path/to/sublime_text
. For linux default installation, need to add sudo
.
For programmers:
// | |
// UILabel+FontSize.Swift | |
// | |
// Created by Nutchaphon Rewik on 7/11/15. | |
// Copyright (c) 2015 Nutchaphon Rewik. All rights reserved. | |
// | |
import UIKit | |
extension UILabel{ |
function DeCasteljauBezier(points, density, step){ | |
//if (points.length < 3) return null; | |
console.time('bezier'); | |
var ps = points.map(function(p){ | |
return { | |
x: p.x, | |
y: p.y | |
}; | |
}), | |
results = [], |