Skip to content

Instantly share code, notes, and snippets.

View Micka33's full-sized avatar

Mickaël CASSY Micka33

View GitHub Profile
@Micka33
Micka33 / install.md
Last active March 17, 2022 10:55
cassandra on mac OSX

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@Micka33
Micka33 / unbounce.md
Last active June 29, 2021 08:59
unbounce validator messages

#Code à mettre:

(function(e){function t(){var t=window.module.lp.form.data;var n=t.validationMessages;var r=t.validationRules;this.changeTitle=function(n){e(function(){e("#"+t.errorContainerId).find("div.error").text(n)})};this.changeField=function(e,t,i){if(!n[e])return;n[e].required=t;if(i&&r[e].email)n[e].email=i;if(i&&r[e].phone)n[e].phone=i}}window.errors=new t(lp.jQuery)})(lp.jQuery)
$(function() {
 setTimeout(function(){

   lp.jQuery.validator.addMethod("phone", function(phone_number, element)
   {
    phone_number = phone_number.replace(/\s+/g, "");
@Micka33
Micka33 / download.sh
Last active August 3, 2018 03:04
Download/install Nginx +some convenient modules (rtmp/lua5.1/upstream-fair/ssl/etc) on Ubuntu
wget http://nginx.org/download/nginx-1.4.5.tar.gz
tar xzf nginx-1.4.5.tar.gz
wget http://zlib.net/zlib-1.2.8.tar.gz
tar xzf zlib-1.2.8.tar.gz
wget http://downloads.sourceforge.net/project/pcre/pcre/8.34/pcre-8.34.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.34%2F&ts=1393362418&use_mirror=kent
mv pcre-8.34.tar.bz2\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.34%2F pcre-8.34.tar.bz2
tar xjf pcre-8.34.tar.bz2
@Micka33
Micka33 / codewars.rb
Created January 28, 2014 14:58
codewars exemple
#Subject
#Find the sum of the digits of all the numbers from 1 to N (both ends included).
#For N = 10 the sum is 1+2+3+4+5+6+7+8+9+(1+0) = 46
#For N = 11 the sum is 1+2+3+4+5+6+7+8+9+(1+0)+(1+1) = 48
#For N = 12 the sum is 1+2+3+4+5+6+7+8+9+(1+0)+(1+1) +(1+2)= 51
#Supported Ruby version is 1.9.3
#Tests
it 'should' do
Test.assert_equals(solution(10), 46)
@Micka33
Micka33 / resize.py
Created January 14, 2014 08:48
script using imageMagic to resize only the images that are bigger than 1460x841
import os
from subprocess import call
import time
from datetime import datetime
import calendar
import re
##
@Micka33
Micka33 / markdown.md
Last active December 31, 2015 14:49
markdown.md

TITRE 1

SOUS TITRE 2

du code

point d'eclamation

du texte normal avec un retour.
a la ligne

@Micka33
Micka33 / full_ffmpeg_and_imagemagick.sh
Last active December 30, 2015 20:19
Install ffmpeg and imagemagick on ubuntu (pretty ugly but it should do it)
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure
apt-get remove ffmpeg x264 libav-tools libvpx-dev libx264-dev yasm
./configure
make
sudo checkinstall --pkgname=yasm --pkgversion="1.2.0" --backup=no --deldoc=yes --fstrans=no --default
apt-get -y install autoconf automake build-essential checkinstall git libass-dev libfaac-dev libgpac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev librtmp-dev libspeex-dev libtheora-dev libtool libvorbis-dev pkg-config texi2html zlib1g-dev
aptitude install checkinstall
@Micka33
Micka33 / railsConsole.rb
Last active December 28, 2015 02:39
how to go through RIAKCS&RIAK to manage files
# Create a user in RIAK & RIAKCS
# Get the user
Me = User.find_by_index(:email, "mickael3@beingenious.com")
Me = User.find '52820a5994da266b19000002'
# Or create a new one
Me = User.new username:'Micka2', email:'mickael2@beingenious.com', firstname:'micka2', lastname:'cassy2', password:'testtest2', password_confirmation:'testtest2'
Me.save
# In RIAKCS, Use FOG
# Instanciate the Fog API to go through RIAKCS
s3 = Fog::Storage.new RiakCS::BucketManager.get_credentials(Me.key_id, Me.key_secret)
@Micka33
Micka33 / nginxproxy.md
Created October 15, 2015 15:36 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@Micka33
Micka33 / text.md
Last active August 29, 2015 14:04
Rspec avec capybara

#capybara_helper.rb

require 'rails_helper'
require 'capybara/rspec'

Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }

RSpec.configure do |config|
  config.extend FeatureMacros, :type => :feature
  Capybara.javascript_driver = :webkit