Skip to content

Instantly share code, notes, and snippets.

Avatar

Henrik Akselsen henrikakselsen

View GitHub Profile
@henrikakselsen
henrikakselsen / which-wordpress-template.php
Last active Jul 5, 2016
Show which template is used by WordPress
View which-wordpress-template.php
// Add this to your functions.php file
add_action('wp_head', 'show_template');
function show_template() {
global $template;
print_r($template);
}
View schemaorg-person.html
<div itemscope itemtype="http://schema.org/ProfilePage">
<div itemscope itemtype="http://schema.org/Person">
<img itemprop="image" class="circle" src="http://cdn2.hubspot.net/hubfs/536142/Frontkom_profiles/[name]2x.jpg" alt="[name]" title="[name]" width="320" style="width: 320; margin: 0px 0px 10px 10px; float: right;" data-constrained="true">
<h1><span itemprop="name">[name]</span></h1>
<p class="lead">
<strong><span itemprop="jobTitle">[title]</span></strong><br>
Telefon: <a href="tel:[phone]"><span itemprop="telephone">[phone]</span></a><br>
E-post: <a href="mailto:[email]"><span itemprop="email">[email]</span></a><br>
Sted: <span itemprop="workLocation">[location]</span>
</p>
View sidetittel
<head>
<title>Sidetittel</title>
</head>
View gist:0e49f38f91222d41d360
alias update_all_packages="
echo \"--- update npm modules ---\";
echo \"--- sudo npm update -g; ---\";
npm update -g;
echo \"--- update npm ---\";
echo \"--- npm install -g npm@latest; ---\";
npm install -g npm@latest;
echo \"--- Update brew --- \";
echo \"--- brew update && brew upgrade `brew outdated` --- \";
brew update && brew upgrade `brew outdated`;
View iframe html
<html lang="no" ng-app="ttApp"><head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Solskjerming. Finn beste / billigste solskjerming</title>
<script type="text/javascript" defer="" async="" src="https://sleeknotestaticcontent.sleeknote.com/piwik.js"></script><script type="text/javascript" async="" src="https://scdn.cxense.com/cx.js"></script><script type="text/javascript" async="" src="https://track.adform.net/serving/scripts/trackpoint/async/"></script><script type="text/javascript" async="" src="https://www.google-analytics.com/analytics.js"></script><script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="jquery_mask" src="./include/themes/default/js/masked_input/igorescobar-jQuery-Mask-Plugin-2f41eff/jquery.mask.min.js"></script><script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="mailcheck" src="./files/js/mailcheck/mailcheck.min.js"></script><base href="http
View parent.html
<!DOCTYPE html>
<body id="parentbody">
<iframe src="iframe.html"></iframe>
</body>
<footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">
View iframe.html
<!DOCTYPE html>
<body id="iframebody">
<button class="btn" id="hello-btn">Hello</button>
</body>
<footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">
View gist:9343044
<?php
/**
* Implement of drush_hook_COMMAND_validate().
*
* Prevent overwriting your prod db.
* Put this in your ~/.drush folder
*/
function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) {
View Drupal activate comments for all nodes of a content type
UPDATE node_revision SET comment=2 WHERE nid IN (SELECT nid FROM node WHERE node.type='my_type');
You can’t perform that action at this time.