Skip to content

Instantly share code, notes, and snippets.

@mcasimir
mcasimir / lamp_setup.sh
Created June 21, 2012 18:27
Set-up di un server LAMP + Sendmail + Git + wp-cli + wp-new + Server ftp
#!/bin/bash
# Set-up di un server LAMP + Sendmail + Git + wp-cli + wp-new + Server ftp
# ===============================
# = Installazione dei pacchetti =
# ===============================
apt-get update
apt-get purge apache2 mysql-server php5 libapache2-mod-php5 php-pear php5-xcache php5-mysql php5-suhosin php5-gd git-core sendmail vsftpd
@mcasimir
mcasimir / remote.rake
Created July 11, 2012 21:28
Remote Setup Rake
namespace :remote do
task :info do
require 'remoting/task'
remote('info', config.login) do
source "/usr/local/rvm/scripts/rvm"
which :ruby
echo "RUBY VERSION: `ruby --version`"
echo "RUBYGEM VERSION: `gem --version`"
@mcasimir
mcasimir / assets.rake
Created July 11, 2012 21:30
Assets Rake
namespace :assets do
task :compile => :environment do
require 'sprockets'
# workaround used also by native assets:precompile:all to load sprockets hooks
_ = ActionView::Base
# ==============================================
# = Read configuration from Rails / assets.yml =
# ==============================================
@mcasimir
mcasimir / Cakefile
Created May 10, 2013 00:33
Coffeebuild static site builder Cakefile example
Coffeebuild = require("../Coffeebuild/src/coffeebuild")
PegSH = require("../PegSH/src/pegsh")
###
Build the site
###
task 'build', 'Build site', ->
@mcasimir
mcasimir / README.md
Created July 27, 2014 22:04
Rails template: Mongoid, Devise, RailsAdmin, Ckeditor, Cloudinary, Mailchimp, Heroku, Carrierwave, Mongoid Essentials: denormalize, slug, search, Tasks Helpers

Rails Template to create a Ready to use cloud CMS.

  • RailsAdmin
  • Patches for RailsAdmin to fix some bugs and add some useful features
  • Mongoid
  • Devise
  • Ckeditor
  • Cloudinary
  • Mandril
  • MongoLab
@mcasimir
mcasimir / migrate-to-mobile-angular-ui.1.2.md
Last active February 23, 2019 11:38
Migrating to Mobile Angular UI 1.2

Migrating to Mobile Angular UI 1.2

Core UI functionalities

Core UI Functionalities are those any HTML UI built on Angular could use. They are not Mobile-specific nor depending on anything else that Angular itself, and you could use them with any css framework.

YieldTo/ContentFor

They are the same that 1.1 beside to be prefixed with ui- so use: ui-yield-to and ui-content-for.

@mcasimir
mcasimir / .editorconfig
Last active October 1, 2015 12:31
Editorconfig
# top-most EditorConfig file
root = true
# Unix-style newlines
[*]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = 2
@mcasimir
mcasimir / .jscsrc
Created January 13, 2016 12:48
.jscsrc
{
"preset": "google",
"esnext": true,
"maximumLineLength": {
"value": 160,
"allExcept": ["comments", "regex"]
},
"excludeFiles": [
"node_modules/**",
"bower_components/**",
@mcasimir
mcasimir / index.js
Last active April 19, 2016 17:11
winston console -> docker gelf log -> logstash
'use strict';
let winston = require('winston');
//
// Test with json format
//
let logger = new winston.Logger({
transports: [
@mcasimir
mcasimir / app.js
Last active August 2, 2016 10:19
kube node app
var os = require("os");
var ifaces = os.networkInterfaces();
var myIfaces = {};
Object.keys(ifaces).forEach(function (ifname) {
var alias = 0;
ifaces[ifname].forEach(function (iface) {
if ('IPv4' !== iface.family || iface.internal !== false) {
// skip over internal (i.e. 127.0.0.1) and non-ipv4 addresses