This file contains 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/bash | |
HOSTSFILE="/etc/hosts" | |
BAKFILE="$HOSTSFILE.bak" | |
DOMAINREGEX="^[a-zA-Z0-9]{1}[a-zA-Z0-9\.\-]+$" | |
IPREGEX="^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" | |
URLREGEX="^https?:\/\/[a-zA-Z0-9]{1}[a-zA-Z0-9\/\.\-]+$" | |
backup() | |
{ |
This file contains 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
//http://stackoverflow.com/questions/26133977/laravel-bulk-update | |
public function updateBatch($tableName = "", $multipleData = array()){ | |
if( $tableName && !empty($multipleData) ) { | |
// column or fields to update | |
//var_dump($multipleData); | |
$updateColumn = array_keys($multipleData[0]); | |
//var_dump($updateColumn); |
This file contains 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
// Authentication based on PingPong Admin package. Use your own authentication package as filter or remove this filter. ( not recommendd ) | |
Route::get('getLog', array('before' => 'admin.auth', function() { | |
$path = storage_path() . "/logs/"; | |
$date = Input::get('date'); | |
try { | |
if (!isset($date)) { | |
$latest_ctime = 0; | |
$latest_filename = ''; |
This file contains 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 update(UpdateCampaignRequest $request, $id) | |
{ | |
$campaign = Campaign::findOrFail($id); | |
//A. Update all Regular Fields | |
$campaign->update($request->all()); | |
//B. Update Terms | |
// B.1. Delete all terms to write a new list |
This file contains 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 | |
# update apt | |
sudo apt-get update | |
# install java | |
sudo apt-get install openjdk-7-jre-headless -y | |
# install elasticsearch | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb |
This file contains 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
[alias] | |
co = checkout | |
ci = commit | |
st = status | |
br = branch | |
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short | |
type = cat-file -t | |
dump = cat-file -p | |
[user] | |
name = Eduardo Chongkan |
This file contains 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
Are you a Costarrican or a Costarrican't? |
This file contains 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 | |
include('simple_html_dom.php'); | |
$propuestasPopularesAsamblea = new propuestasPopularesAsamblea(); | |
$propuestasPopularesAsamblea->index(); | |
This file contains 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 | |
# This script will install a Git pre-commit hook that stop accidental commits to master and develop branches. | |
# There is also a variant that includes a core.whitespace check. See pre-commit-2 below. | |
# Install in current Git repo: | |
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh | |
# Install with core.whitespace check: | |
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-2 | |
# Install with core.whitespace check and EOF-newline-check: | |
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-3 | |
# Install only core.whitespace check: |
This file contains 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 | |
include('simple_html_dom.php'); | |
$diputadosCostaRica = new DiputadosCostaRica(); | |
$diputadosCostaRica->index(); | |
OlderNewer