Skip to content

Instantly share code, notes, and snippets.

View dannystyleart's full-sized avatar
:octocat:

Dániel Sebestyén dannystyleart

:octocat:
View GitHub Profile
@dannystyleart
dannystyleart / MANUAL.md
Created May 14, 2018 20:54 — forked from s-lyn/MANUAL.md
Deploy nodejs app with gitlab.com and pm2

Deploy nodejs app with gitlab.com and pm2

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.
@dannystyleart
dannystyleart / git_create_orphan.sh
Created April 25, 2018 07:13 — forked from seanbuscay/git_create_orphan.sh
Create an orphan branch in a repo.
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
@dannystyleart
dannystyleart / index.js
Created July 25, 2017 10:55
UI Router usage
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'
@dannystyleart
dannystyleart / webpack.server.config.js
Created June 4, 2017 07:52 — forked from madx/webpack.server.config.js
Webpack config for an Express app in Node.js
const path = require("path")
const fs = require("fs")
// -- Webpack configuration --
const config = {}
// Application entry point
config.entry = "./src/server/index.js"
@dannystyleart
dannystyleart / ultimate-ut-cheat-sheet.md
Created May 10, 2017 06:18 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@dannystyleart
dannystyleart / C:\Users\<user>\.atom\init.coffee
Created April 28, 2016 06:32
Atom.io editor hungarian keymap fix
# 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
)
@dannystyleart
dannystyleart / export_commit.sh
Created May 13, 2015 19:38
Beginner git commit export [UBUNTU]
#!/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;
@dannystyleart
dannystyleart / functions.php
Created October 1, 2014 23:25
Part of highly used snippet, to get the taxonomy terms of WP posts
//
// 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(
@dannystyleart
dannystyleart / Font-installer.less
Last active August 29, 2015 13:56
Font-installer.less is a mixin for easily install one or more webfont on our site. By preparing package solo or multi we can get rid of human faults of linking or naming the webfonts. IMPORTANT! IT WAS NOT TESTED ON LESS.JS ONLY ON LESSPHP 0.4.0
/*==========================================================*/
/* 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 //