Skip to content

Instantly share code, notes, and snippets.


Saeid saeidzebardast

View GitHub Profile
View sort-object.js
* Sort object by key
* @param unordered object
* @returns {Object} ordered object by key
function sortObject(unordered) {
var ordered = {};
Object.keys(unordered).sort().forEach(function (key) {
ordered[key] = unordered[key];
saeidzebardast / .gitignore
Last active Mar 29, 2016
.gitignore for Unity3d projects
View .gitignore
# Unity generated
# Visual Studio / MonoDevelop generated
saeidzebardast / Enable CORS in Spark Java
Created Mar 8, 2016
Enable CORS in Spark Java to allow origins *
View Enable CORS in Spark Java
(request, response) -> {
String accessControlRequestHeaders = request
if (accessControlRequestHeaders != null) {
View Maven rules for jenkins Log Parser Plugin
# Compiler Error
error /ERROR/
# Compiler Warning
warning /WARNING/
# Compiler Info
info /INFO/
# Start Build Step
View Get number of Polymer elements in your project using hydrolysis.js
var hyd = require('hydrolysis');
.then(function(analyzer) {
// console.log(analyzer.elements); // A list of all elements the Analyzer has metadata for.
console.log('Total elements: ' + analyzer.elements.length);
saeidzebardast /
Last active Feb 13, 2019 — forked from nolanlawson/
Setting up local-npm as a launch daemon on OS X and Ubuntu.

Setting up local-npm on OS X and Ubuntu

These instructions will set up local-npm so that it runs as a launch daemon, meaning that it will start up whenever you log in.

Install local-npm

First, install local-npm and pm2:

npm install -g local-npm
saeidzebardast / redirect_post_location.php
Created Dec 21, 2015
WordPress: Redirect to add new post on publish or save
View redirect_post_location.php
add_filter('redirect_post_location', 'redirect_to_add_new_post_on_publish_or_save');
function redirect_to_add_new_post_on_publish_or_save(){
if (isset($_POST['save']) || isset($_POST['publish'])) {
$pl = get_admin_url('', 'post-new.php');
if ($pl) {
saeidzebardast / youtube-dl-playlist
Last active Oct 28, 2019
Download Youtube playlist in a folder and indexing videos using youtube-dl
View youtube-dl-playlist
alias youtube-dl-playlist="youtube-dl --ignore-errors --output '%(playlist)s/%(playlist_index)s- %(title)s.%(ext)s'"
cat ~/.ssh/ | ssh <user>@<host> "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" && echo "done."