Skip to content

Instantly share code, notes, and snippets.

View AlexTiTanium's full-sized avatar

Alex Kucherenko AlexTiTanium

View GitHub Profile
@lukescott
lukescott / gist:36453a75c39c539f5c7d
Last active February 12, 2024 00:00
Traits in ES6 now
/*
var Trait1 = {
method1() {}
};
var Trait2 = {
method2() {}
};
var Trait3 = mixin({
import base64
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
"""
Cryptography helpers, used for cookie encryption by AES(Rijmen-128) encryption algorithm
"""
@clarkdave
clarkdave / nconf-yaml.js
Created August 20, 2014 11:19
Load YAML config files using nconf (nodejs)
var nconf = require('nconf');
var yaml = require('js-yaml');
var app_config = __dirname + '../config/application.yml';
// load cmd line args and environment vars
nconf.argv().env();
// load a yaml file using a custom formatter
nconf.file({
@pnegahdar
pnegahdar / Mongodb Upstart
Last active December 30, 2015 18:19 — forked from aaronlerch/README.md
MMS agent and Backup Agent upstart/service scripts.
## Download
Download and install the agent(s). These examples are on a standard 64-bit Amazon EC2 Linux AMI.
*MMS*
```
wget [path to mms agent download, specified by 10gen]
sudo tar xvzf 10gen-mms-agent-[CUSTOM_NAME].tar.gz -C /opt
```
@positron96
positron96 / gist:7269466
Last active July 23, 2023 12:03 — forked from chrismeyersfsu/oscilloscope.c
Supports panning and vertical scaling
/*
* Oscilloscope
* Gives a visual rendering of analog pin 0 in realtime.
*
* This project is part of Accrochages
* See http://accrochages.drone.ws
*
* (c) 2008 Sofian Audry (info@sofianaudry.com)
*
* This program is free software: you can redistribute it and/or modify
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@k33g
k33g / kind.js
Created April 2, 2012 20:29
Re Use Object Model of BackBone
// Just do this : (and include backbone.js)
var Kind = function() {
this.initialize && this.initialize.apply(this, arguments);
};
Kind.extend = Backbone.Model.extend
//Simpler
var Thing = function() {};
Thing.extend = Backbone.Model.extend
@alkema
alkema / deploy.rb
Created July 9, 2011 20:01
Capistrano task for a Node.js app with github Forever and NPM.
set :application, "appname"
set :deploy_to, "/var/www"
set :scm, :git
set :repository, "git@github.com:user/app.git"
default_run_options[:pty] = true
set :user, "www-data"
set :domain, "foo.tld"
set :normalize_asset_timestamps, false
@johnthethird
johnthethird / cap_notify.rb
Created May 4, 2011 20:02 — forked from rtekie/cap_notify.rb
Capistrano deployment email notifier for Rails 3
=begin
Capistrano deployment email notifier for Rails 3
Do you need to send email notifications after application deployments?
Christopher Sexton developed a Simple Capistrano email notifier for rails. You can find details at http://www.codeography.com/2010/03/24/simple-capistrano-email-notifier-for-rails.html.
Here is Rails 3 port of the notifier.
The notifier sends an email after application deployment has been completed.
@danmackinlay
danmackinlay / supervisord.sh
Created August 27, 2009 07:07
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.