Skip to content

Instantly share code, notes, and snippets.

swift-library

Curated list of my favourite Swift Library

###Carthage A simple, decentralized dependency manager for Cocoa

https://github.com/Carthage/Carthage

###Alamofire Elegant HTTP Networking in Swift

<?php
class Nric_validation{
function is_NRIC($nric)
{
if(strlen($nric)==9) // NRIC is alway 9 Digits
{
$nric = strtoupper($nric);
$prefix = substr($nric,0,1);
$postfix = substr($nric,8,1);
$ic_number = substr($nric,1,7);
@cmariod
cmariod / swift-slack.swift
Created August 21, 2016 10:17 — forked from kiichi/swift-slack.swift
Swift Slack Integration
// icon
// http://www.emoji-cheat-sheet.com/
// for test use direct message e.g. @kiichi
let payload = "payload={\"channel\": \"#dev\", \"username\": \"bot\", \"icon_emoji\":\":calling:\", \"text\": \"hello\"}"
let data = (payload as NSString).dataUsingEncoding(NSUTF8StringEncoding)
if let url = NSURL(string: "https://hooks.slack.com/services/(your slack incoming webhook url)")
{
var request = NSMutableURLRequest(URL: url)
request.HTTPMethod = "POST"
@cmariod
cmariod / swift-ubuntu.md
Created August 31, 2016 06:47
Installing swift on ubuntu

Installation

Based on Twilio Install guide

sudo apt-get update

wget https://swift.org/builds/ubuntu1404/swift-2.2-SNAPSHOT-2015-12-18-a/swift-2.2-SNAPSHOT-2015-12-18-a-ubuntu14.04.tar.gz

tar -zxvf swift-2.2-SNAPSHOT-2015-12-18-a-ubuntu14.04.tar.gz

@cmariod
cmariod / lamp-stack-osx-virtualhostx.md
Created March 28, 2017 02:38 — forked from pwenzel/lamp-stack-osx-virtualhostx.md
LAMP stack on OSX with Homebrew, built-in Apache, multiple PHP versions, VirtualhostX optional

This guide shows how to set up a PHP and MySQL development environment using OSX's built-in Apache, using Homebrew to install necessary components. With this strategy, you can use different versions of PHP for certain virtual hosts.

VirtualHostX is a convenient way to manage development sites, but not required.

Install PHP and MySQL with Homebrew

brew update
brew install php56
brew install php56-mcrypt
brew install mysql
<?php
function true_func() {
echo "\nTRUE FUNC";
return true;
}
function false_func() {
echo "\nFALSE FUNC";
return false;
}