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
<!-- index.html.erb --> | |
<% form_tag search_path do %> | |
<%= select :search, :state, State.all.collect { |m| [m.full_name, m.id] }.sort, {:prompt=>'Please Select...'} %> | |
<%= observe_field(:state, :url => { :action => :update_city_menu }, | |
:update => :city_field_div, | |
:with => :state | |
) %> | |
<div id="city_field_div"></div> | |
<%= submit_tag 'Submit' %> |
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 | |
$formMatch = array(); | |
$code = '<form name="otro_texto_que_sacare">texto_que_sacare</form>'; | |
preg_match_all("/<form (.*?)>(.*?)<\/form>/i", $code, $matches, PREG_SET_ORDER); | |
foreach ($matches as $data) | |
{ | |
print_r($data); | |
} |
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
require 'net/http' | |
require 'json' | |
#HACER UN GET REQUEST | |
def getRequest(url) | |
url = URI.parse(url) | |
req = Net::HTTP::Get.new(url.path) | |
res = Net::HTTP.start(url.host, url.port) {|http| | |
http.request(req) | |
} |
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 | |
# Install dependencies | |
yum update -y | |
yum install -y gcc apr-devel apr-util-devel openssl-devel pcre-devel libxml2-devel libcurl-devel | |
# Or just make your own installation for apr | |
mkdir setup && cd setup | |
wget <url_to_apache>.tar.gz | |
tar -zxvf <apache>.tar.gz |
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
LOCK FILE +, UNLOCK - chattr -i /etc/httpd/conf/httpd.conf | |
NETWORKING | |
ifconfig eth0 up | |
history | grep ifconfig | |
ifconfig eth0:1 <ip> | |
tracert <domain> | |
watch "echo stats | nc 127.0.0.1 11211" | |
FILE PERMISSIONS |
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
GIT | |
=== | |
[PUBLIC REPO] https://www.kernel.org/pub/software/scm/git/ | |
[DELETE ALL RM] git rm $(git ls-files --deleted) | |
[DELETE BRANCH DOWN] git branch <branchName> --delete | |
[DELETE BRANCH UP] git push origin --delete <branchName> |
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
-------------------- | |
Configuracion Basica | |
-------------------- | |
//Configurarar Nombre que salen en los commits\\ | |
git config --global user.name "daniel sanchez" | |
//Configurar Email\\ | |
git config --global user.email [email protected] | |
//marco de colores para los comandos\\ | |
git config --global color.ui true |
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
# config valid only for Capistrano 3.1 | |
lock '3.2.1' | |
# APPLICATION | |
set :application, '<application_name>' | |
set :repo_url, '<repo>' | |
# GIT | |
set :deploy_to, '<deploy_to>' | |
set :deploy_via, :remote_cache |
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 | |
/* * ** | |
* | |
* This script converts an existing MySQL database to migrations in Laravel 4. | |
* | |
* 1. Place this file inside app/controllers/ | |
* | |
* 2. In this file, edit the index() method to customize this script to your needs. | |
* - inside $migrate->ignore(), you pass in an array of table |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer