Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Cipto Hadi cipto-hd

🎯
Focusing
  • Lamongan, Indonesia
View GitHub Profile
@cipto-hd
cipto-hd / main.dart
Created May 30, 2020 16:11
Using Map to describe stories flow in Dart Lang. Awesome
View main.dart
main() {
void nextStory(int userChoice) {
int _storyNumber = 4;
_storyNumber = {
0: {1: 2, 2: 1},
1: {1: 2, 2: 3},
2: {1: 5, 2: 4},
3: {1: 0, 2: 0},
4: {1: 0, 2: 0},
@cipto-hd
cipto-hd / boot-repair-install
Created February 5, 2018 22:42
install boot repair
View boot-repair-install
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install boot-repair
boot-repair
@cipto-hd
cipto-hd / maps_wordcount.go
Last active October 12, 2017 15:19
A Tour of Go Exercises
View maps_wordcount.go
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 / BladeExtendServiceProvider.php
Last active September 14, 2017 10:08
ServiceProvider that create custom Laravel Blade directive for relative include (from the calling blade tempale)
View BladeExtendServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class BladeExtendServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
@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.
View preg_helper.php
<?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 / index.php
Created September 12, 2017 12:16
entry file for Adminer for enabling plugin to work
View index.php
<?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 / css.css
Created December 25, 2014 04:41
gist collection
View css.css
/*!
* 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 / for-while-do_loop
Created June 22, 2014 07:48
for, while, do --> loop
View 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 / rock-paper-scissors_game
Last active August 29, 2015 14:02
Rock, Paper, Scissors choice game, Code Academy course js exercise
View rock-paper-scissors_game
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 / JavascriptCourse@CodeAcademy
Last active August 29, 2015 14:02
Javascript course at Code Academy
View JavascriptCourse@CodeAcademy
/*
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 = [];