This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Ex: | |
* | |
* Object = function () {} | |
* Object.prototype = new AbstractEventsDispatcher; | |
* | |
* Object.trigger("event", arguments); | |
*/ | |
var AbstractEventsDispatcher = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// path where the files should be deleted | |
define('PATH', '/.'); | |
// delete only files older than OLDER_THAN_DAYS days | |
define('OLDER_THAN_DAYS', 14); | |
// delete only files that match MATCH_NAME | |
define('MATCH_NAME', '/some regexp/i'); | |
// do NOT actually delete the files | |
define('DRYRUN', false); | |
// sleep SLEEP_USEC microsecconds after each delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pidfile=/path/to/the/pidfile | |
function stopDomain { | |
echo "Sutting down domain." | |
/path/to/bin/asadmin stop-domain name | |
} | |
function startDomain { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
testIfArray: function (arr) { | |
return !!arr && Array.isArray(arr); | |
}, | |
testIfObject: function (obj) { | |
return !this.testIfArray(obj) && typeof obj === 'object'; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
stdin { | |
type => "stdin-type" | |
} | |
udp { | |
port => "9999" | |
} | |
tcp { | |
port => "9998" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var mongoose = require('mongoose'); | |
var _ = require('lodash'); | |
var conn; | |
function clearDB() { | |
var cleaned = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
~/.nvm/nvm.sh use default | |
node $@ | ./node_modules/.bin/bunyan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ `nvram get https_enable` -gt 0 ] ; then | |
# get the absolute directory of the executable | |
SELF_PATH=$(cd -P "$(dirname "$0")" && pwd -P) | |
echo SELF_PATH: ${SELF_PATH} | |
# extract the mount path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
export LC_CTYPE=en_US.UTF-8 | |
export LC_ALL=en_US.UTF-8 | |
export PATH=/Users/alexandrusavin/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Based on gist.github.com/gboudreau/install-ffmpeg-amazon-linux.sh | |
# and https://trac.ffmpeg.org/wiki/CompilationGuide/Centos | |
if [ "`/usr/bin/whoami`" != "root" ]; then | |
echo "You need to execute this script as root." | |
exit 1 | |
fi | |
cat > /etc/yum.repos.d/centos.repo<<EOF |
OlderNewer