Skip to content

Instantly share code, notes, and snippets.

@devyfriend
devyfriend / tglsekarang.js
Created August 2, 2016 19:54
tanggal sekarang dengan format indonesia
jQuery(document).ready(function($){
function getTime(){
var text="";
var d=new Date();
var days=['Minggu','Senin','Selasa','Rabu','Kamis','Jum\'at','Sabtu'];
text +=days[d.getDay()];
var tanggal=d.getDate();
text +=', '+tanggal;
var bulan=['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli','Agustus', 'September', 'Oktober', 'Nopember', 'Desember'];
text +=' '+bulan[d.getMonth()];
@devyfriend
devyfriend / index.html
Last active July 16, 2016 23:25
CSS "Always on the bottom" Footer
<style>
/**
* Demo Styles
*/
html {
height: 100%; /* <-- this is it --> */
box-sizing: border-box;
}
@devyfriend
devyfriend / navi-onhover.html
Last active July 13, 2016 09:31
popup dropdown navi with modal background
<!DOCTYPE html>
<html>
<head>
<style>
.dropbtn {
background-color: #4CAF50;
color: white;
padding: 16px;
font-size: 16px;
border: none;
@media (min-width: 768px) {}
@media (min-width: 992px) {}
@media (min-width: 1200px) {}
@media screen and (max-width: 767px) {}
@media screen and (min-width: 768px) {}
@media screen and (-webkit-min-device-pixel-ratio: 0) {}
@media (max-device-width: 480px) and (orientation: landscape) {}
@media (max-width: 767px) {}
@media all and (transform-3d), (-webkit-transform-3d) {}
@media (min-width: 768px) and (max-width: 991px) {}
@devyfriend
devyfriend / terbilang_helper
Created March 28, 2015 20:27
ci_helper terbilang
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Terbilang Helper
*
* @package CodeIgniter
* @subpackage Helpers
* @category Helpers
* @author Gede Lumbung
* @link http://gedelumbung.com
@devyfriend
devyfriend / localdate_helper
Last active August 29, 2015 14:17
ci_helper tanggalan lokal
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
if ( ! function_exists('tgl_indo'))
{
function tgl_indo($tgl)
{
$ubah = gmdate($tgl, time()+60*60*8);
$pecah = explode("-",$ubah);
$tanggal = $pecah[2];
$bulan = bulan($pecah[1]);
@devyfriend
devyfriend / mysql_addon
Last active August 29, 2015 14:17
CodeIgniter MySQL "on duplicate key update"
source: http://web.archive.org/web/20090221091226/http://codeigniter.com/forums/viewthread/80958/
add function to two files
1st file: /system/database/drivers/mysql/mysql_driver.php and perhaps file mysqli_driver.php too
/**
* ON DUPLICATE UPDATE statement
*
* Generates a platform-specific on duplicate key update string from the supplied data
*
@devyfriend
devyfriend / designer.html
Created October 18, 2014 21:46
designer
<link rel="import" href="../cool-clock/cool-clock.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@devyfriend
devyfriend / ci_table_field_metadata
Created October 14, 2014 11:07
codeigniter read table and field metadata
function readDB()
{
$tables = $this->db->list_tables();
foreach($tables as $table){
$query = $this->db->field_data($table);
echo '<h5>'.$table.'</h5>';
echo '<ul>';
foreach ($query as $field)
{
echo '<li>'.$field->name.' - '.$field->type.' '.($field->primary_key ? '- <b>primary</b>':''). '</li>';
<IfModule mod_deflate.c>
# force deflate for mangled headers
# developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>