Skip to content

Instantly share code, notes, and snippets.

Iván Cabrera sanPuerquitoProgramador

Block or report user

Report or block sanPuerquitoProgramador

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sanPuerquitoProgramador
sanPuerquitoProgramador / Romina.php
Last active Jun 13, 2018
Library for CI; The common taks for development
View Romina.php
<?php defined('BASEPATH') OR exit('No direct script access allowed');
Class Romina{
public function __construct()
{
date_default_timezone_set('America/Mexico_City');
setlocale(LC_TIME, 'es_ES');
$this->load->library('session');
$this->load->library('user_agent');
$this->load->database();
@sanPuerquitoProgramador
sanPuerquitoProgramador / BaseModel.php
Last active Feb 11, 2018
Base Model for CodeIgniter. It's assumes your tables has crated_at and updated_at fields. The Insert and Update functions fill and updated those fields automatically
View BaseModel.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Base_model extends CI_Model{
/**
* { function_description }
*/
function __construct()
{
parent::__construct();
}
@sanPuerquitoProgramador
sanPuerquitoProgramador / hiddenfiles
Last active Jan 12, 2018
Script para mostrar y ocultar los archivos ocultos de la mac. Muy util cuando trabajas con .htaccess y otros archivos
View hiddenfiles
display dialog "Archivos ocultos" buttons {"Mostrar", "Ocultar"}
set result to button returned of result
if result is equal to "Mostrar" then
do shell script "defaults write com.apple.finder AppleShowAllFiles -boolean true"
else
do shell script "defaults delete com.apple.finder AppleShowAllFiles"
end if
do shell script "killall Finder"
@sanPuerquitoProgramador
sanPuerquitoProgramador / .htaccess
Created Jun 12, 2017
htaccess for CodeIngniter projects
View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [QSA,L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
@sanPuerquitoProgramador
sanPuerquitoProgramador / Update remote repo
Last active Jan 26, 2017 — forked from mandiwise/Update remote repo
Transfer repo from Bitbucket to Github
View Update remote repo
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push --set-upstream origin master
$ git remote rm bitbucket
View ci_url_helper.js
/* simple snippet for create Code Igniter base_url() and site_url() in JavaSCript */
<script type="text/javascript">
var js_site_url = function( urlText ){var urlTmp = "<?php echo site_url('" + urlText + "'); ?>";return urlTmp;}
var js_base_url = function( urlText ){var urlTmp = "<?php echo base_url('" + urlText + "'); ?>";return urlTmp;}
</script>
/* e.g. use in js in the same way use in PHP Code Igniter*/
<script>
js_site_url('main/ajaxcall');
</script>
You can’t perform that action at this time.