Skip to content

Instantly share code, notes, and snippets.

View manfromanotherland's full-sized avatar
🤏

Edmundo Santos manfromanotherland

🤏
View GitHub Profile
@manfromanotherland
manfromanotherland / readme.md
Last active September 12, 2016 13:39
Slate API docs generator
@manfromanotherland
manfromanotherland / Wordpress-Database-Overview.md
Last active January 1, 2020 16:40
Wordpress database overview and useful SQL Queries for Wordpress sites

Wordpress Database

Overview of Wordpress database tables:

  • wp_commentmeta: contains information about comments posted on the Wordpress site, it has four fields: meta_id, comment_id, meta_key, and meta_value. Each meta_id is related to a comment_id. Example of meta information would be the status of a comment.
  • wp_comments: it contains comment author name, url, email, comment, etc.
  • wp_links: used to manage blogrolls
  • wp_options: contains most of Wordpress settings such as site url, admin email, default category, posts per page, etc. This table is also used by numerous plugins to store plugins settings.
  • wp_postmeta: contains meta information about posts, pages, and custom post types. Examples of meta information would be which template to use to display a page, custom fields, and so on. Some plugins also store plugin data in this table.
  • wp_posts: contains all posts, pages, revisions, and custom post types.
@manfromanotherland
manfromanotherland / nav.js
Last active October 6, 2016 09:56
JS: Simple solution to open navigation panel
/**
* Nav Toggle
* Inspired by John's Hamburgler http://johnm.io/project/hamburgler/
*/
(function() {
document.getElementById('js-nav').addEventListener('click', checkNav);
window.addEventListener("keyup", function(e) {
<!-- Essential META Tags -->
<meta property="og:title" content="European Travel Destinations">
<meta property="og:description" content="Offering tour packages for individuals or groups.">
<meta property="og:image" content="http://euro-travel-example.com/thumbnail.jpg">
<meta property="og:url" content="http://euro-travel-example.com/index.htm">
<meta name="twitter:card" content="summary_large_image">
<!-- Non-Essential, But Recommended -->
<meta name="og:site_name" content="European Travel, Inc.">
@manfromanotherland
manfromanotherland / darkside-custom-font.css
Created June 20, 2016 15:35
Using a custom typeface on Dark Side Tumblr theme http://darkside-theme.tumblr.com/
/* Body text */
body {
font-family: "Fira Sans", sans-serif;
}
/* Headings */
h1,
h2,
@manfromanotherland
manfromanotherland / email-description.html
Last active May 17, 2016 04:30
HTML: Add description text to a email newsletter
<html>
<head>
<title>Add description text to newsletter</title>
</head>
<body>
<span style="font-size: 0; line-height: 0; width: 0; height: 0; display: none; overflow: hidden;">
Your description here.
</span>
</body>
</html>
@manfromanotherland
manfromanotherland / fisher-yater-shuffle.js
Last active October 6, 2016 10:20
JS: Fisher-Yater Shuffle
// Fisher-Yater Shuffle
function shuffle(array) {
var n = array.length, t, i;
while (n) {
i = Math.random() * n | 0; // 0 <= i < n
t = array[--n];
array[n] = array[i];
array[i] = t;
}
return array;
@manfromanotherland
manfromanotherland / random-dwarf.js
Created August 7, 2015 23:45
JS: selecting a random dwarf from a list
var luckyDraw = ["Thorin", Fili", Kili", Balin", Dwalin", Oin", Gloin", Dori", Nori", Ori", Bifur", Bofur", Bombur"];
function pickRandomPerson(luckyDraw){
var index = Math.floor(Math.random() * (luckyDraw.length -1));
return luckyDraw[index];
}
pickRandomPerson(luckyDraw);
@manfromanotherland
manfromanotherland / for-loop.js
Created August 7, 2015 23:39
JS: Basic for loop
// Basic for loop
for(var i = 0; i < 5; i++) {
// ...
}
@manfromanotherland
manfromanotherland / textedit-new-blank-file.sh
Last active August 29, 2015 14:21
Make TextEdit open with new blank file by default
defaults write -g NSShowAppCentricOpenPanelInsteadOfUntitledFile -bool false