Skip to content

Instantly share code, notes, and snippets.

View helmutgranda's full-sized avatar

Helmut Granda helmutgranda

View GitHub Profile
@helmutgranda
helmutgranda / p4_revert_changes.md
Last active August 29, 2015 13:56
Perforce revert changes to a file workflow

Perforce: Revert changes to a file (commandline - workflow)

p4 sync [filename]#revisionNumber

p4 edit [filename]

p4 resolve [filename]

(merge-revert changes)

@helmutgranda
helmutgranda / kickstrap_steps.md
Last active January 4, 2016 02:19
Steps taken during the KickStrap presentation

go to http://getkickstrap.com/ and follow the installation instructions

create a new site

$ kickstrap new customsite

A new site will launch on localhost and port 1111 (you can change the port if needed)

-create a new layout by

  • duplicating newpage.jade
  • rename about.jade
  • open about.jade
  • edit var active
  • edit title
@helmutgranda
helmutgranda / p4_workflow
Last active January 3, 2016 15:19
p4 workflow with sublime text
p4 sync [filename - or directory]
p4 edit [filename]
p4 submit -d "Commit comment" [filename]
-- extra
p4 filelog [filename] # get log changes info.
@helmutgranda
helmutgranda / fiddle.css
Last active December 26, 2015 02:19 — forked from zalun/fiddle.css
body {
font-family: Helvetica, Verdana
}
p {
padding: 7px 10px;
}
#demo {
border: 1px solid #999;
}
@helmutgranda
helmutgranda / wordpress_update_string_mysql
Created October 2, 2013 21:55
WordPress - Update strings on database
#Update main content
UPDATE wp_posts SET post_content = REPLACE ( post_content, 'http://www.helmutgranda.com/', 'https://www.helmutgranda.com/');
#Update Custom fields
UPDATE wp_postmeta SET meta_value = REPLACE ( meta_value, 'http://www.helmutgranda.com/', 'https://www.helmutgranda.com/');
@helmutgranda
helmutgranda / list_of_world_countries
Created August 29, 2013 20:11
List of World Countries
$country_list = array(
"Afghanistan",
"Albania",
"Algeria",
"Andorra",
"Angola",
"Antigua and Barbuda",
"Argentina",
"Armenia",
"Australia",
@helmutgranda
helmutgranda / dreamhost_ssh
Last active December 15, 2015 08:29
SSH to Dreamhost without having to enter credentials every time.
([ -f ~/.ssh/id_rsa.pub ] || ssh-keygen -t rsa ) && (ssh user@example.com "([ -d ~/.ssh ]||mkdir -m 700 ~/.ssh) && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys" < ~/.ssh/id_rsa.pub)
@helmutgranda
helmutgranda / curl_commandline
Last active December 14, 2015 06:19
Minify with CURL on the command line
curl \
-d output_info=compiled_code \
-d compilation_level=SIMPLE_OPTIMIZATIONS \
-d code_url=https://github.com/path/to/javascript.js \
http://closure-compiler.appspot.com/compile > file.js
@helmutgranda
helmutgranda / getaformbyxpath.js
Created November 6, 2012 14:57
Get a form by XPath | CasperJS
var formObj = casper.evaluate(function() {
return __utils__.getElementsByXPath('//*[@id="ff_form_main"]');
});
@helmutgranda
helmutgranda / restart_apache.sh
Created March 7, 2012 17:59
Restart Apache 2
$ /etc/init.d/apache2 restart