Skip to content

Instantly share code, notes, and snippets.

View r3nya's full-sized avatar
☮️
¯\_(ツ)_/¯

Andrew M. r3nya

☮️
¯\_(ツ)_/¯
View GitHub Profile
gulp = require 'gulp'
coffee = require 'gulp-coffee'
concat = require 'gulp-concat'
uglify = require 'gulp-uglify'
plumber = require 'gulp-plumber'
notify = require 'gulp-notify'
slim = require 'gulp-slim'
serve = require "gulp-serve"
sass = require 'gulp-ruby-sass'

Bower, how to use

app.js - фрагмент кода из обычного приложения на express.js директорию bower_components сделаем для отдачи статических файлов, так же как и директорию public

app.use(express.static(path.join(__dirname, 'public')));
app.use('/bower_components',  express.static(__dirname + '/bower_components'));
  • Далее установим bootstrap
#!/bin/sh
##
## Redhat / Linux / LSB
##
# chkconfig: 345 80 20
# description: Startup script for Express / Node.js application with the \
## forever module.
##
## A modification of https://gist.github.com/1339289
##
@r3nya
r3nya / nodejs
Last active August 29, 2015 14:09
#!/bin/sh
#
# chkconfig: 35 99 99
# description: Node.js /home/nodejs/sample/app.js
#
. /etc/rc.d/init.d/functions
USER="nodejs"
@r3nya
r3nya / openvpn.md
Last active August 29, 2015 14:10 — forked from padde/openvpn.md

OpenVPN on Ubuntu 12.10 at DigitalOcean

Install OpenVPN

sudo apt-get install openvpn

Generate Server Certificates

sudo cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0 /etc/openvpn/easy-rsa2

cd /etc/openvpn/easy-rsa2

// to get the current latitude and longitude from browser
// credits https://github.com/arunisrael/angularjs-geolocation
'use strict';
angular.module('geolocation',[]).constant('geolocation_msgs', {
'errors.location.unsupportedBrowser':'Browser does not support location services',
'errors.location.notFound':'Unable to determine your location',
});
angular.module('geolocation')
---
- hosts: web
user: root
vars:
http_port: 80
max_clients: 200
tasks:
- name: install apache
yum: name=httpd state=latest
- name: write apache config
@r3nya
r3nya / gulpfile.js
Last active August 29, 2015 14:16
Translite
var gulp = require('gulp'),
path = require('path'),
rename = require('gulp-rename'),
translit = require('translitit-cyrillic-russian-to-latin');
gulp.task('files', function () {
gulp.src('./файл.txt')
.pipe(rename(function (path) {
path.basename = translit(path.basename);
}))
@r3nya
r3nya / Install_fira.sh
Created February 27, 2015 08:36
Install Fira fonts
#!/bin/bash
cd /tmp
# install unzip just in case the user doesn't already have it.
sudo apt-get install unzip -y
wget "http://www.carrois.com/wordpress/downloads/fira_3_1/FiraFonts3111.zip"
unzip FiraFonts3111.zip