Skip to content

Instantly share code, notes, and snippets.

@marcialca
marcialca / gist:4068430
Created November 13, 2012 21:12
Ubuntu reinstall process
##Ubuntu Reinstall progres
1. Install / and /home apart, so it's easier to make a reinstall
2. Backup all packages!
2.1. Create a REINSTALL directory in your Home. The type in Terminal in the directory:
sudo apt-get update
dpkg --get-selections > /REINSTALL/installed-programs.log
2.2. Save you GPG keys
@marcialca
marcialca / gist:4151769
Created November 27, 2012 01:17
[MYSQL]WP from local to server
UPDATE wp_options SET option_value = replace(option_value, 'http://localhost:8888/wordpress', 'http://www.YOUR_SITE_URL.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE (guid, 'http://localhost:8888/wordpress', 'http://www.YOUR_SITE_URL.com');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://localhost:8888/wordpress', 'http://www.YOUR_SITE_URL.com');
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://localhost:8888/wordpress','http://www.YOUR_SITE_URL.com');
@marcialca
marcialca / gist:4527901
Created January 14, 2013 05:14
[CSS] Faux Gradient using an Image and CSS
From: http://webdesign.tutsplus.com/tutorials/visuals/quick-tip-using-images-as-fullscreen-faux-gradient-backgrounds/
1. Use a 300x300 img
2. Apply a gaussian blur with a radious of 40 or more
3. Apply the CSS
body{
margin: 0;
background: url('img/bg.jpg');
background-size: 100% 100%;
background-attachment: fixed;
@marcialca
marcialca / query_post
Created May 10, 2013 05:10
Create and Show Taxonomies on Wordpress
/* show the taxonomies per post */
<?php echo get_the_term_list($post->ID, 'people', 'People: ', ', ', ''); ?>
@marcialca
marcialca / flag
Created May 10, 2013 05:19
Flag & Media Object
/* IE8+ */
.flag{
display:table;
width:100%;
}
.flag__image,
.flag__body{
display:table-cell;
@marcialca
marcialca / $.js
Created May 14, 2013 21:36 — forked from yeco/$.js
// Based on https://github.com/james2doyle/saltjs
window.$ = function(s) {
return document[{
'#': 'getElementById',
'.': 'getElementsByClassName',
'@': 'getElementsByName',
'=': 'getElementsByTagName'}[s[0]]
|| 'querySelectorAll'](s.slice(1))
};
@marcialca
marcialca / new_gist_file
Created June 8, 2013 06:26
Wordpress Sites Feeds
Main – site.com/feed
Main comments – site.com/comments/feed
Post comments – site.com/post-name/feed
Categories & tags – site.com/category/categoryname/feed or site.com/tag/tagname/feed
You can also include / exclude categories like this – site.com/?cat=42,25,17&feed=rss2 or this site.com/?cat=-123&feed=rss2
Author – site.com/author/authorname/feed/
@marcialca
marcialca / featured
Created June 8, 2013 06:27
Add Featured Image to Wprdpress
@marcialca
marcialca / gzip
Created June 8, 2013 06:29
Enable GZIP Wordpress
#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
</ifmodule>
#End Gzip
@marcialca
marcialca / reset
Created June 18, 2013 05:25
Reset MySQL root Password
Paramos el servidor MySQL:
sudo /etc/init.d/mysql stop
Arrancamos la configuración de mysqld:
sudo mysqld --skip-grant-tables &
Login en MySQL como root:
mysql -u root mysql
Cambiamos la contraseña por nuestra NuevaContraseña: