This file contains 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
function calculate_median($arr) { | |
$count = count($arr); //total numbers in array | |
$middleval = floor(($count-1)/2); // find the middle value, or the lowest middle value | |
if($count % 2) { // odd number, middle is the median | |
$median = $arr[$middleval]; | |
} else { // even number, calculate avg of 2 medians | |
$low = $arr[$middleval]; | |
$high = $arr[$middleval+1]; | |
$median = (($low+$high)/2); | |
} |
This file contains 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 | |
/** | |
* Kelas untuk memanipulasi data yang berkaitan dengan rupiah. | |
* | |
* Catatan: Saya lupa darimana contoh fungsi terbilang awalnya! | |
* | |
* @version 0.0.1 | |
* @author Anggiajuang Patria <[email protected]> | |
* @copyright (c) 2009-2010 http://www.segellabs.com/ | |
* @license http://www.gnu.org/licenses/gpl-3.0.txt |
This file contains 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
(function($){ | |
$.widget("ui.mywidget", { | |
options: { | |
autoOpen: true | |
}, | |
_create: function(){ | |
// by default, consider this thing closed. |
This file contains 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
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 | |
# $Id: Portfile 71588 2010-09-17 05:21:24Z [email protected] $ | |
PortSystem 1.0 | |
name php5 | |
conflicts php5-devel php52 | |
# Update revision of php5-eaccelerator when updating version of php5 | |
epoch 1 | |
version 5.3.3 |
This file contains 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
#!/bin/bash | |
# | |
# Open new Terminal tabs from the command line | |
# | |
# Author: Justin Hileman (http://justinhileman.com) | |
# | |
# Installation: | |
# Add the following function to your `.bashrc` or `.bash_profile`, | |
# or save it somewhere (e.g. `~/.tab.bash`) and source it in `.bashrc` | |
# |
This file contains 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 | |
{ | |
/** | |
* ActionScript 3.0 Code Snippet | |
* Convert Number to Rupiah & vice versa | |
* https://gist.github.com/845309 | |
* | |
* Copyright 2011-2012, Faisalman | |
* Licensed under The MIT License | |
* http://www.opensource.org/licenses/mit-license |
This file contains 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" | |
"io" | |
"log" | |
"net/http" | |
"os" | |
) |
This file contains 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
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
This file contains 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 | |
if (!isset($modules)) { | |
$modulus = 11; | |
} | |
if (!isset($model)) { | |
$models = ClassRegistry::keys(); | |
$model = Inflector::camelize(current($models)); | |
} | |
?> | |
<div class="pagination"> |
This file contains 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 BootstrapFormHelper extends AppHelper { | |
public $helpers = array('Html', 'Form'); | |
public function input($name, $options = array()) { | |
$default = array( | |
'type' => null, | |
'label' => null, | |
'before' => null, // to convert .input-prepend |
OlderNewer