Skip to content

Instantly share code, notes, and snippets.

View pujie's full-sized avatar
👨‍🍳
Enjoying @nGular

pujie pujie

👨‍🍳
Enjoying @nGular
View GitHub Profile
@pujie
pujie / orm.js
Created June 10, 2022 09:46
my simple orm
showError = obj => {
switch(obj.errCode){
case '1':
return 'No table specified'
break
case '2':
return 'Main table has no name'
break
}
}
@pujie
pujie / flex-responsif.html
Created April 25, 2022 03:56
implementation of responsive flex
<html>
<head>
<title>Transpose</title>
<style>
#main{
display: flex;
flex-direction: row;
color:chartreuse;
}
@media screen and (max-width:1000px){
@pujie
pujie / inspect.js
Created April 13, 2022 09:17
script to inspect input
inspect = {
isNumber : indexes => {
inspect._numberIndexes = indexes
return inspect
},
setParam : param => {
console.log(param)
inspect._param = param
return inspect
},
@pujie
pujie / isEmail.js
Created March 29, 2022 09:04
validate multiple elements
isEmail = element => {
arr1 = element.split('@')
if(arr1.length === 0){
return false
}else if(arr1[0].trim() === ""){
return false
}else if(arr1[1].trim() === ""){
return false
}else{
return true
@pujie
pujie / tanggal_regex_php
Created August 10, 2011 09:31
php regex for date (id)
<?php
echo '<h2>yyyy/mm/dd</h2>';
preg_match('/(19[5-9][0-9]|20[0-9][0-9])[\/-](0[1-9]|1[0-2])[\/-](0[1-9]|1[0-9]|2[0-9]|3[01])/','2011/12/30',$match);
foreach($match as $key=>$val){
echo $key . ' => ' . $val . '<br>';
}
echo '<h2>dd/mm/yyyy</h2>';
preg_match('/(0[1-9]|1[0-9]|2[0-9]|3[01])[\/-](0[1-9]|1[0-2])[\/-](19[5-9][0-9]|20[0-9][0-9])/','30/12/2011',$match);
foreach($match as $key=>$val){
@pujie
pujie / login.html
Created October 19, 2015 03:20
simulasi login 2
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<div>
<input type="text" name="user" id="user"><br />
<input type="text" name="pass" id="pass"><br />
<button id="submit" >Login</button>
</div>
@pujie
pujie / simulasi-eo.php
Created October 19, 2015 01:32
simulasi login sederhana
<html>
<head>bercanda</head>
<body>
<form action="index.php" method="post">
Nama <input type="text" name="name"/><br />
Pass <input type="text" name="pass"/>
<input type="submit" value="LOGIN">
</form>
<?php
$users = array(
@pujie
pujie / config.php
Created July 5, 2011 09:07
menu library for codeigniter
/*
add this to your config.php
*/
$config['css']='css_style.css';
@pujie
pujie / vhgrid.js
Created April 1, 2011 10:00
vhgrid
<html>
<head>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="vhgrid.main.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#mybutton").click(function(){
$("#mytable").createTable();
@pujie
pujie / override fullcalendar
Created September 3, 2015 06:27
override fullcalendar
var options = {
theme: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
timeFormat: {
agenda: 'h(:mm)t{ - h(:mm)t}',
'': 'h(:mm)t{-h(:mm)t }'