Skip to content

Instantly share code, notes, and snippets.

View jorwan's full-sized avatar

Jorge Wander Santana Ureña jorwan

View GitHub Profile
@jorwan
jorwan / git_commands
Last active August 29, 2015 14:06 — forked from frangeris/commands.md
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>
@jorwan
jorwan / commands
Created August 6, 2014 20:07 — forked from frangeris/commands
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
#!/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
<?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);
}
<!-- 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' %>