This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = "http://simas.bandaacehkota.go.id/index.php?mod=masjid&act=json_masjid&order=asc&offset=0"; | |
$source = file_get_contents($url); | |
$data = json_decode($source); | |
$total = $data->total; | |
foreach ($data->rows as $row) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function store(Request $request) | |
{ | |
$validator = Validator::make($request->all(), [ | |
'first_name' => 'required|max:100', | |
'last_name' => 'required|unique:user,last_name,NULL,id,first_name,'.$request->first_name.'|max:100', | |
]); | |
.... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
use_genimotion=false | |
while : | |
do | |
case "$1" in | |
-g | --genymotion) | |
use_genymotion=true | |
shift 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"silex/silex" : "~1.3", | |
"silex/web-profiler" : "~1.0", | |
"symfony/http-kernel" : "~2.8", | |
"symfony/event-dispatcher" : "~2.8", | |
"symfony/filesystem" : "~2.8", | |
"symfony/http-foundation" : "~2.8", | |
"symfony/intl" : "~2.8", | |
"symfony/property-access" : "~2.8", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
### BEGIN INIT INFO | |
# Provides: something warm and fuzzy | |
# Required-Start: vboxdrv | |
# Required-Stop: vboxdrv | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts suspended vagrant boxes and suspends running vagrant boxes | |
# Description: | |
### END INIT INFO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# | |
Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/ | |
Updated by: Simon Schick <[email protected]> | |
Parameters: | |
* currentFilters (array) : associative array that contains the current route-arguments | |
* currentPage (int) : the current page you are in | |
* paginationPath (string) : the route name to use for links | |
* showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled) | |
* lastPage (int) : represents the total number of existing pages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# rename Filename.Exention jadi filename.extension (lowercase) | |
find . -type f | sed 's/\(.*\/\)\(.*\)/mv "\1\2" "\1\L\2"/' | |
# cari semua file mp3 yang mau diproses, hasilnya disimpan di file text | |
find . -type f | grep mp3$ > mp3-files.txt | |
# baca file text tersebut sebagai array | |
readarray -t files < mp3-files.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
usage() { | |
echo "Usage: ./project create|remove <PROJECT> [-r<DOMAIN>]" | |
exit | |
} | |
create() { | |
# Setup variables | |
DIR=$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('BASEPATH') or die(); | |
/** | |
* Filename: application/libraries/Orm.php | |
* | |
* composer.json : | |
* { | |
* "require": { | |
* "illuminate/database": "5.0.27", | |
* "illuminate/events": "5.0.26", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET FOREIGN_KEY_CHECKS = 0; | |
SET @tables = NULL; | |
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables | |
FROM information_schema.tables | |
WHERE table_schema = 'DATABASE_NAME'; -- specify DB name here. | |
SET @tables = CONCAT('DROP TABLE ', @tables); | |
PREPARE stmt FROM @tables; | |
EXECUTE stmt; | |
DEALLOCATE PREPARE stmt; |
NewerOlder