Skip to content

Instantly share code, notes, and snippets.

View cactis's full-sized avatar

chitsung.lin cactis

View GitHub Profile
@Pulimet
Pulimet / AdbCommands
Last active May 21, 2024 06:50
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@cactis
cactis / bezier.js
Last active March 9, 2016 12:36 — forked from LiuJi-Jim/bezier.js
De Casteljau Bezier
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 = [],
@vitorbritto
vitorbritto / rm_mysql.md
Last active May 20, 2024 19:44
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@dduan
dduan / NSAttributedString+SimpleHTMLTag.swift
Created December 7, 2014 05:59
Convert Simple Text With HTML Tags to NSAttributedString
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 {
@vertexclique
vertexclique / cracking.md
Last active May 11, 2024 21:17
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

@jacklynrose
jacklynrose / RubyMotionTheRailsWay.md
Last active August 29, 2015 13:57
Ideas on how to write RubyMotion apps the "Rails" way

RubyMotion The "Rails" Way

This is a current proposal that I'd like your feedback on for how we can clean up how we write RubyMotion applications. It's purely conceptual at the moment, and there would have to be some framework development to make this work the way described here.

Please submit your feedback, as a joint effort we can clean up our RubyMotion applications and make it easier for Rails developers to expand their skills into RubyMotion development.

Goals

The main points of this are:

@chareice
chareice / Rakefile
Created February 8, 2014 06:38
Hide Status Bar in rubymotion
app.info_plist['UIStatusBarStyle'] = 'UIStatusBarStyleBlackTranslucent'
app.info_plist["UIViewControllerBasedStatusBarAppearance"] = false
@j4rs
j4rs / instagram.rb
Last active August 5, 2020 20:16
Integrating Instagram(OAuth) using RubyMotion, Promotion, AFMotion and some SugarCube
class Instagram < PM::WebScreen
title "Instagram"
CLIENT_ID = 'your client id'
REDIRECT_URI = 'http://your.domain.com/auth/instagram/callback'
FAILURE_URL = 'http://your.domain.com/auth/failure'
AUTH_URI = "https://instagram.com/oauth/authorize/?client_id=#{CLIENT_ID}&redirect_uri=#{REDIRECT_URI}&response_type=token"
class << self
def api
class EventCell < UITableViewCell
IDENTIFIER = 'EventCell'
PADDING = 10
LEFT_MARGIN = 40
RIGHT_MARGIN = 20
attr_reader :event
def initWithStyle(style, reuseIdentifier: reuse_identifier)
super.tap do |cell|
@owenkellogg
owenkellogg / rubymotion_location_bubblewrap.rb
Created May 16, 2013 23:26
rubymotion get location with bubble wrap
BW::Location.get(distance_filter: 10, desired_accuracy: :nearest_ten_meters) do |result|
geocoder = CLGeocoder.alloc.init
geocoder.reverseGeocodeLocation result[:to], completionHandler: lambda {|location, x|
alert = UIAlertView.alloc.init
alert.message = "#{location[0].locality} : #{location[0].postalCode}"
alert.show
}
end