This manual is about setting up an automatic deploy workflow using nodejs, PM2, nginx and GitLab CI. It is tested on:
- Target server: Ubuntu 16.04 x64. This is suitable for Ubuntu 14.x.
- Windows 10 on my PC to work.
cd repository | |
git checkout --orphan orphan_name | |
git rm -rf . | |
rm '.gitignore' | |
echo "#Title of Readme" > README.md | |
git add README.md | |
git commit -a -m "Initial Commit" | |
git push origin orphan_name |
angular.module('org.prod.module', ['ui.router']) | |
.config(['$stateProvider', function($stateProvider) { | |
// Correct state definition for a simple in-app state e.g.: authorized | |
$stateProvider.state('app.module.dashboard', { | |
parent: 'app', | |
// App should be an abstract state and by setting parent this state can inherit configs and resolved data | |
url: 'welcome', | |
views: { | |
// By using the @ sign at the end of the view template placeholder it means 'this is the template to show until someone overrides it' |
const path = require("path") | |
const fs = require("fs") | |
// -- Webpack configuration -- | |
const config = {} | |
// Application entry point | |
config.entry = "./src/server/index.js" |
using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
# Your init script | |
# Fixes AltGr problems on Hungarian keyboard layouts in Windows | |
# for characters [ (AltGr+F), < (AltGr+M), \ (AltGr+Q) and { (AltGr+B) | |
atom.keymaps.keyBindings = atom.keymaps.keyBindings.filter((binding, i) -> | |
['ctrl-alt-f','ctrl-alt-q','ctrl-alt-b','ctrl-alt-m'].indexOf(binding.keystrokes) == - 1 | |
) |
#!/bin/bash | |
# Before running this with cronjob make sure your session was attached to dev/null | |
# by adding the following line to your .bashrc | |
# xhost local:dannystyle > /dev/null | |
# Settings | |
# ========== | |
# Send email? - Working SMTP will needed | |
EMAIL_SEND=true; |
// | |
// Get terms by taxonomy | |
// | |
// @param $tax_name - Taxonomy key of terms | |
// @param bool $array_return - If true results returned as arrays, otherwhise objects | |
// @return mixed | |
// | |
function get_terms_by_taxonomy($tax_name, $array_return = true){ | |
global $wpdb; |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
/*==========================================================*/ | |
/* WEBFONT INSTALLER */ | |
/*==========================================================*/ | |
/* NOTES: | |
This mixin creates the needed @font-face import rules for custom webfont-kits | |
Can install one font or a whole package because it could loop its self by giving a number as argument. | |
///////////////////// | |
// PREPARE SOURCES // |