Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Agus Cahyono balitax

🏠
Working from home
View GitHub Profile
View layoutSection.swift
func layoutSection() -> NSCollectionLayoutSection {
var setWidthColumn: CGFloat = 0
var setHeight: CGFloat = 0
if column == 2 {
setWidthColumn = 0.5
setHeight = 0.75
} else if column == 3 {
setWidthColumn = 0.33
setHeight = 0.5
@balitax
balitax / counting_1_digit.swift
Created Oct 18, 2019
Count a number into 1 digit value
View counting_1_digit.swift
import Foundation
import UIKit
var number = 55555
// means 5+5+5+5+5 = 30 , so 3+0 = 3
func countDigits(_ digit: Int) -> Int {
var nums = digit
View fibonacci.swift
import Foundation
func fibonacci(_ number: Int) -> [Int] {
var fibonacci = [Int]()
for n in 0...number {
if n == 0 {
fibonacci.append(0)
View Reach.swift
// The MIT License (MIT)
//
// Copyright (c) 2015 Isuru Nanayakkara
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@balitax
balitax / APIEnvironment.swift
Last active Sep 3, 2018
APIEnvironment.swift
View APIEnvironment.swift
//
// APIEnvironment.swift
// DOT APIEnvironment
//
// Created by Agus Cahyono on 07/08/18.
// Copyright © 2018 Agus Cahyono. All rights reserved.
//
import Foundation
@balitax
balitax / APIManager.swift
Last active Sep 13, 2018
APIManager.swift
View APIManager.swift
//
// ApiManager.swift
// DOTAPI
//
// Created by Agus Cahyono on 16/04/18.
// Copyright © 2018 Agus Cahyono. All rights reserved.
//
import Foundation
import Alamofire
@balitax
balitax / blogspot-list.php
Created Jun 30, 2016 — forked from arbo77/blogspot-list.php
Blogspot content parser using PHP CUrl, last update using Google Blogger API
View blogspot-list.php
<?php
/*
* read more on :
* https://developers.google.com/blogger/docs/3.0/getting_started
*
*/
$key["server"] = "YOUR_BLOGGER_API_KEY";
$blogId = "YOUR_BLOG_API";
View README.md

This uses Twitter Bootstrap classes for CodeIgniter pagination.

Drop this file into application/config.