This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // list files in a directory | |
| // code adapted from github.com/replicon/fast-archiver | |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "io" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "reflect" | |
| ) | |
| type Foo struct { | |
| FirstName string `tag_name:"tag 1"` | |
| LastName string `tag_name:"tag 2"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // A small utility to resize images inside folder (including subfolder). | |
| package main | |
| import ( | |
| "fmt" | |
| "flag" | |
| "math" | |
| "os" | |
| "io/ioutil" | |
| "os/exec" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('SYSPATH') or die('No direct script access.'); | |
| /** | |
| * OAuth2 sample controller | |
| * | |
| */ | |
| class Controller_Auth extends Controller { | |
| protected $session; | |
| protected $provider; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """ | |
| np.py - NowPlaying (https://github.com/Devkill/NowPlaying/) | |
| Copyright 2011, devkill, www.devkill.net | |
| Licensed under the sukatoro n ycl Forum License 3. | |
| http://sukatoro.com/ | |
| http://yogyacarderlink.web.id | |
| #yogyacarderlink #1stlink #magelangcyber | |
| """ | |
| import dbus, gobject |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('SYSPATH') or die('No direct script access.'); | |
| /** | |
| * This mechanism provides support for PHP [One-way string hashing](http://php.net/manual/en/function.crypt.php). | |
| * | |
| * Currently, only support 3 hashing type: blowfish, sha256, sha512 | |
| * | |
| * @package Bonafide | |
| * @category Mechanisms | |
| * @author Wouter <wouter.w@gmx.net> | |
| * @author Devi Mandiri <devi.mandiri@gmail.com> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php defined('SYSPATH') or die('No direct script access.'); | |
| /** | |
| * MySQL "Closure Table" for Kohana based on Bill Karwin design. | |
| * | |
| * @link http://www.slideshare.net/billkarwin/models-for-hierarchical-data | |
| * @TODO improve | |
| * | |
| * sql schema: | |
| * CREATE TABLE `closures` ( | |
| * `id` int(11) NOT NULL AUTO_INCREMENT, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Pagination { | |
| public static function factory($total, $limit = 5, $page = 1, $adjacents = 2) | |
| { | |
| return new Pagination($total, $limit, $page, $adjacents); | |
| } | |
| public $total; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // lower alpha | |
| // alnum followed by alnum or (hyphen, dash or slash between alnum) | |
| function valid_path($path) | |
| { | |
| return (bool) preg_match('/^[a-z0-9]+([-_\/][a-z0-9]+)*$/iD', $path); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // lower alpha | |
| // alnum followed by alnum or hyphen between alnum | |
| function valid_slug1($value) | |
| { | |
| return (bool) preg_match('/^[a-z0-9]+(-[a-z0-9]+)*$/iD', (string) $value); | |
| } |