Skip to content

Instantly share code, notes, and snippets.

View a9un9hari's full-sized avatar

Agung Hari Wijaya a9un9hari

View GitHub Profile
<?php
function do_upload()
{
$this->load->library('upload');
$files = $_FILES;
$cpt = count($_FILES['userfile']['name']);
for($i=0; $i<$cpt; $i++)
{
<?php
$date = array();
$months = array();
$years = array();
$yearsFull = array();

git rm . -r --cached git add . git commit -m "fixed untracked files"

.main-menu a {
overflow: hidden;
padding: 0 12px;
height:17px;
}
.main-menu a span {
position: relative;
display: inline-block;
-webkit-transition: -webkit-transform 0.3s;
@a9un9hari
a9un9hari / simpleDailyGitWorkflow.md
Created October 5, 2013 01:08
Just simple daily git flow :D

git pull //pull all the change from remote repository git checkout -b branch-name-here //create new branch for your bug/feature/issue

"Do Your Work Here" "keep it in small chunks, the smaller your commits the better, in case things go wrong" git add . // add any new file or/and modify any file git status or/and git diff // see the changes you're going to commit git commit -m "Detailed messages here" //make the commit with a nice detailed messages back go to line 4 until your bug/feature/issue finish

$(document).ready(function(){
$('input').each(function() {
var default_value = this.value;
$(this).focus(function() {
if(this.value == default_value) {
this.value = '';
}
});
$(this).blur(function() {
if(this.value == '') {
$(document).ready(function(){
$("input[placeholder], textarea[placeholder]").each(function(i, e){
if($(e).val() == "")
{
$(e).val($(e).attr("placeholder"));
}
$(e).blur(function(){
if($(this).val()=="")
$(this).val($(e).attr("placeholder"));
}).focus(function(){
@a9un9hari
a9un9hari / flatbootstrap.css
Created September 22, 2013 02:51
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers,Bootstrap 2.0
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@a9un9hari
a9un9hari / swapValue.php
Created September 16, 2013 07:58
swap value variables tanpa menggunakan temporary , intinya kalau ada 2 gelas a = susu b = kopi kita bisa menukarnya tanpa gelas lain asal ada skat antara keduanya agar tidak bercampur ^_^
<?php
$a = 3;
$b = 5;
echo $a.' - '.$b.'<br/>';
$a = $a.'-'.$b;
$a = explode('-',$a);
$b = (int)$a[0];
$a = (int)$a[1];
echo $a.' - '.$b;
?>
@a9un9hari
a9un9hari / Language Class Extended DB
Created August 20, 2013 03:32
This is more or less an example on how to extend the core language class to fetch language lines from a database if the language file doesn't exist.
[[Category:Libraries::Extended]]
### Extending Language Class
This is more or less an example on how to extend the core language class to fetch language lines from a database if the language file doesn't exist.
Works identically the same as the existing core class with no extra params required.
Everything you'll need or need to know is in the code comments. Enjoy... feel free to expand on it and repost it, or whatever.
```php