Skip to content

Instantly share code, notes, and snippets.

View norsez's full-sized avatar
💭
busy coding

Norsez Orankijanan norsez

💭
busy coding
View GitHub Profile
@norsez
norsez / ThaiiOSDevelopersUnited.md
Created June 29, 2012 05:19
Thai iOS Developers United

#Thai iOS Developers United #THiOS

เราคือกลุ่ม iOS Developer จาก Thailand ครับ ขอเชิญทุกท่านเข้ามาช่วยกันเรียนรู้ แก้ปัญหา และร่วมมือทาง open source เกี่ยวกับ iOS และ network กันไว้ครับ หากสนใจเข้าร่วมส่งเมสเสจมาหา Owner ท่านใดก็ได้ในกลุ่ม https://github.com/organizations/Thai-iOS-Developers-United ครับ

##เราใช้ Gist และ Twitter ในการสื่อสารในกลุ่ม Thai iOS Developers United ###ใช้ Twitter ในการสื่อสาร ริเริ่มไอเดีย ถามปัญหา (ขอเป็นปัญหาที่ไม่มีอธิบายชัดเจนแล้วใน iOS Programming References นะครับ) และ พูดคุยกันได้บน Twitter @THiOSDev ครับ

@norsez
norsez / การใช้ Git ฉบับรีบร้อน.md
Created June 29, 2012 09:19
การใช้ Git ฉบับรีบร้อน #THiOS

#การใช้ Git ฉบับรีบร้อน

##Git Git เป็น revision control แบบ distributed (หมายความว่าไม่มีศูนย์กลาง) และ แบบ non-linear history (หมายความว่ามีประวัติการเปลี่ยนแปลงแบบไม่ใช่เส้นตรง) ดังนั้นทำให้คอนเซปต์ของ Git นั้นต่างจาก revision control รุ่นก่อนหน้าหลายอย่าง

ต่อไปจะอธิบายย่อๆเรื่องคำสั่ง Git โดยอิงกับการทำงานใน GitHub เป็นสำคัญ (Git มีวิธีใช้พลิกแพลงมากมาย ไปศีกษาการใช้อื่นได้ด้วยการไป Google เอาเอง)

##clone

สมมุติว่ามี repository แห่งนีงใน GitHub เช่น https://github.com/norsez/projectA

@norsez
norsez / Iphone Icon.png Bash Script
Created July 19, 2012 10:00 — forked from jessedc/iOS Icon.png bash script
A simple bash script using OSX command line tool sips to resample a 512x512px image
#!/bin/bash
f=$(pwd)
sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork"
sips --resampleWidth 57 "${f}/${1}" --out "${f}/Icon.png"
sips --resampleWidth 114 "${f}/${1}" --out "${f}/Icon@2x.png"
sips --resampleWidth 29 "${f}/${1}" --out "${f}/Icon-Small.png"
sips --resampleWidth 58 "${f}/${1}" --out "${f}/Icon-Small@2x.png"
sips --resampleWidth 50 "${f}/${1}" --out "${f}/Icon-Small-50.png"
sips --resampleWidth 72 "${f}/${1}" --out "${f}/Icon-72.png"
@norsez
norsez / BDDimGlassView.podspec
Created September 11, 2012 07:21
How to write custom pod spec to include another lib or even an app for internal use with svn
Pod::Spec.new do |s|
s.name = 'BDDimGlassView'
s.version = '0.0.1'
s.license = 'BSD'
s.summary = 'Dim Glass bordered container for UIViews.'
s.description = 'description here.'
s.homepage = 'https://github.com/norsez'
s.author = {'Norsez Orankijanan' => 'norsez.github@gmail.com'}
#This is the revision of BitApp this app uses
@norsez
norsez / gist:4129399
Created November 22, 2012 04:08
UNIX command line image Resizing
sips -Z 640 *JPG
@norsez
norsez / UIImage+Rotation.swift
Last active February 19, 2023 04:54
Rotate UIImage by radians in Swift 3
extension UIImage {
func image(withRotation radians: CGFloat) -> UIImage {
let cgImage = self.cgImage!
let LARGEST_SIZE = CGFloat(max(self.size.width, self.size.height))
let context = CGContext.init(data: nil, width:Int(LARGEST_SIZE), height:Int(LARGEST_SIZE), bitsPerComponent: cgImage.bitsPerComponent, bytesPerRow: 0, space: cgImage.colorSpace!, bitmapInfo: cgImage.bitmapInfo.rawValue)!
var drawRect = CGRect.zero
drawRect.size = self.size
let drawOrigin = CGPoint(x: (LARGEST_SIZE - self.size.width) * 0.5,y: (LARGEST_SIZE - self.size.height) * 0.5)
@norsez
norsez / MovieWriter.swift
Created May 11, 2017 04:13 — forked from isthisjoe/MovieWriter.swift
Swift 3 | macOs | Write NSImage(s) to a movie file. Modified from http://stackoverflow.com/a/36297656/1275125
import AppKit
import AVFoundation
class MovieWriter: NSObject {
func writeImagesAsMovie(_ allImages: [NSImage], videoPath: String, videoSize: CGSize, videoFPS: Int32) {
// Create AVAssetWriter to write video
guard let assetWriter = createAssetWriter(videoPath, size: videoSize) else {
print("Error converting images to video: AVAssetWriter not created")
return
}
@norsez
norsez / Date+ISO8601.swift
Created June 21, 2017 05:18
Swift 3: Date <-> ISO 8601 String conversion
extension Date {
static func ISOStringFromDate(date: Date) -> String {
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
dateFormatter.timeZone = TimeZone(abbreviation: "GMT")
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS"
return dateFormatter.string(from: date).appending("Z")
}
@norsez
norsez / comments_and_likes.py
Last active August 25, 2017 06:48
Dumping a Facebook post's comments and likes into CSV files
# Loading post comments and likes by Norsez Orankijanan nor@telenordigital.com
# based on example by James Thornton, http://jamesthornton.com
# Facebook API Docs
# https://developers.facebook.com/docs/graph-api/using-graph-api#reading
# Get Your Facebook Access Token Here...
# https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=me
# Before running this script...
@norsez
norsez / MediumRSSXMLParser.swift
Last active April 30, 2018 02:38
Medium.com RSS XML parser written in Swift
// Created by norsez on 30/4/18.
import Foundation
struct RssItem {
var title = "unknown"
var categories: [String] = []
var pubDate = "unknown"
var link = "http://"
var content = "<h1>Hello World</h1>"
var creator = "n.a."