Skip to content

Instantly share code, notes, and snippets.

View cipto-hd's full-sized avatar
🎯
Focusing

Cipto Hadi cipto-hd

🎯
Focusing
  • Lamongan, Indonesia
View GitHub Profile
@cipto-hd
cipto-hd / embed-code-example
Created May 30, 2014 08:00
embed-code-example
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
@cipto-hd
cipto-hd / JavascriptCourse@CodeAcademy
Last active August 29, 2015 14:02
Javascript course at Code Academy
/*
Find a name on strings using array, for loops, substr
*/
text = "Blah blah blah blah blah blah Eric \
blah blah blah Eric blah blah Eric blah blah \
blah blah blah blah blah Eric";
var myName = "blah";
var hits = [];
@cipto-hd
cipto-hd / rock-paper-scissors_game
Last active August 29, 2015 14:02
Rock, Paper, Scissors choice game, Code Academy course js exercise
var userChoice;
var getUserChoice = function(){
var userChoice = prompt("Choose rock, paper, scissors!");
if((userChoice != null) && !(userChoice==="rock" || userChoice==="paper" || userChoice==="scissors" )) {getUserChoice();}
return userChoice;
};
userChoice = getUserChoice();
if(userChoice === null) console.log("Cancel play the game");
@cipto-hd
cipto-hd / for-while-do_loop
Created June 22, 2014 07:48
for, while, do --> loop
// Write your code below!
for(var i=0;i<3;i++){console.log("Subhanallah")}
var i=3;
while(i--){console.log("Alhamdulillah")}
var i=2;
do{console.log("La ilaha illallah")}while(i--)
@cipto-hd
cipto-hd / css.css
Created December 25, 2014 04:41
gist collection
/*!
* Bootstrap v3.3.1 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
.btn-default,
.btn-primary,
.btn-success,
.btn-info,
@cipto-hd
cipto-hd / index.php
Created September 12, 2017 12:16
entry file for Adminer for enabling plugin to work
<?php
function adminer_object() {
// required to run any plugin
include_once "./plugins/plugin.php";
// autoloader
foreach (glob("plugins/*.php") as $filename) {
include_once "./$filename";
}
@cipto-hd
cipto-hd / preg_helper.php
Created September 14, 2017 08:11 — forked from klmr/preg_helper.php
Function to merge several regular expressions into one single expression.
<?php
/**
* Copyright 2008-2009 Konrad Rudolph
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@cipto-hd
cipto-hd / BladeExtendServiceProvider.php
Last active September 14, 2017 10:08
ServiceProvider that create custom Laravel Blade directive for relative include (from the calling blade tempale)
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class BladeExtendServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
@cipto-hd
cipto-hd / maps_wordcount.go
Last active October 12, 2017 15:19
A Tour of Go Exercises
package main
import (
"golang.org/x/tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
wordsMap := make(map[string]int)
@cipto-hd
cipto-hd / boot-repair-install
Created February 5, 2018 22:42
install boot repair
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install boot-repair
boot-repair