If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"
npm adduser
#!/usr/bin/env bash | |
set -e | |
#set -x # for debugging | |
# daily backups with logs crontab -e example: | |
# 0 1 * * * /home/user/path/to/this/file -u my-user -p 'my-pw' -d mydb -t 90 >>/home/user/logs/backup.log 2>&1 | |
MONGO_PW="" | |
TTL=180 |
server { | |
listen 80; | |
server_name example.com; | |
location /analytics { | |
auth_basic "Restricted Access"; | |
auth_basic_user_file /etc/nginx/htpasswd.users; | |
# the only tricky part is that kibana won't work without the rewrite rule | |
# to proxy from another port and use "location /", you can leave out the rewrite rules | |
rewrite ^/analytics(.*)$ $1 break; |
#!/usr/bin/env bash | |
#set -x # for debugging | |
SSH_HOST="user@www.sample.com" | |
# using -f and -o exitOnForwardFailure is helpful, but if you are managing processes that restart and you want to keep | |
# the tunnel open even after a restart this can be difficult (e.g. nodemon with a remote mongo, mysql, elasticsearch, etc) | |
# | |
# instead you can open the tunnels and close them on script exit |
add_action('atom_entry', 'add_thumbnail_to_feed'); | |
add_action('rdf_item', 'add_thumbnail_to_feed'); | |
add_action('rss_item', 'add_thumbnail_to_feed'); | |
add_action('rss2_item', 'add_thumbnail_to_feed'); | |
function add_thumbnail_to_feed(){ | |
global $post; | |
if ( has_post_thumbnail( $post->ID ) ){ | |
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' ); | |
$url = $thumb['0']; | |
echo "<thumbnail>$url</thumbnail>"; |
script(id='greeting', type='text/html') | |
div#example | |
Hello my name is, <%= name %>! |
var ffi = require('ffi'), | |
ref = require('ref'), | |
Struct = require('ref-struct'), | |
Library = require('./Library'), | |
Type = ref.Type, | |
NULL = ref.NULL, | |
isNull = ref.isNull; | |
var groups = ['libs', 'types', 'structs', 'callbacks', 'enums']; |
DISQUS.addBlocks("theme")(function (d) { | |
d.blocks.letUsKnow = function (f, c) { | |
var a = new d.Builder, | |
h = DISQUS.extend({}, f, c); | |
with(h) return a.put('<a href="https://www.surveymonkey.com/s/GHK872T" target="_blank">'), a.put(gettext("Let us know.")), a.put("</a>"), a.compile() | |
}; | |
d.blocks.relatedThread = function (f, c) { | |
var a = new d.Builder, | |
h = DISQUS.extend({}, f, c); | |
with(h) return a.put(' <li class="discovery-unit"> <div class="discovery-heading-wrapper"> <h3 title="'), a.put((a.esc || function (a) { |
var DISQUS = function (e) { | |
var g = e.DISQUS || {}; | |
g.AssertionError = function (b) { | |
this.message = b | |
}; | |
g.AssertionError.prototype.toString = function () { | |
return "Assertion Error: " + (this.message || "[no message]") | |
}; | |
g.assert = function (b, d, f) { | |
if (!b) if (f) e.console && e.console.log("DISQUS assertion failed: " + d); |
//Wait for relevant code bits to load before starting any tests | |
define(['core.js'], function( core ) { | |
module("Core Tests"); | |
test("Test core methods", function(){ | |
expect(2); | |
equals( 1, 1, "A trivial test"); | |
ok( true, "Another trivial test"); | |
}); |