Skip to content

Instantly share code, notes, and snippets.

View smahi's full-sized avatar

Abesse Smahi smahi

  • Tamanrasset / Algeria
View GitHub Profile
@smahi
smahi / wordpress-nginx.conf
Created April 30, 2017 09:33 — forked from chrisblackwell/wordpress-nginx.conf
WordPress nginx confuration
server {
listen 80 default_server;
server_name domain.tld;
access_log /srv/www/domain.tld/logs/access.log;
error_log /srv/www/domain.tld/logs/error.log;
root /srv/www/domain.tld/public;
index index.php index.html index.htm;
client_max_body_size 20M;
# How to echobot with XMPP, BOSH, and Strophe
1. Setup ejabberd(http://www.ejabberd.im/) server and setup account admin@localhost.local
NOTE: localhost should be enough. If you setup something else, make sure you add it at /etc/hosts like this
#/etc/hosts
127.0.0.1 localhost.local
NOTE: Also download Psi(http://psi-im.org/), and make sure you can connect to your ejabberd server.
2. Download strophe(http://code.stanziq.com/strophe/) and place it (eg: /Users/makoto/work/sample/strophejs-1.0)
@smahi
smahi / install-ejabberd.sh
Created July 29, 2016 00:11 — forked from jll90/install-ejabberd.sh
Install ejabberd on centos7
#! bin bash
#This script installs a ejabberd on centos7
echo 'Updating packages...'
sudo yum update -y
echo 'Install wget'
sudo yum install wget -y
echo 'Download EPEL'
@smahi
smahi / package.json
Created July 14, 2016 22:10 — forked from Couto/package.json
Test case for file uploads with Hapi.js. Currently failing when same request is made with a simple JSON.
{
"name": "file-upload",
"version": "1.0.0",
"description": "File Upload test case",
"main": "server.js",
"dependencies": {
"hapi": "^8.0.0-rc8",
"joi": "^5.0.2"
},
"devDependencies": {
@smahi
smahi / app.html
Created July 9, 2016 08:50 — forked from jdanyow/app.html
Aurelia Validation Demo
<template>
<require from="./registration-form"></require>
<registration-form></registration-form>
</template>
@smahi
smahi / node-and-npm-in-30-seconds.sh
Created December 26, 2015 08:34 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
defaults write com.jetbrains.rubymine ApplePressAndHoldEnabled -bool false
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@smahi
smahi / es.sh
Last active August 29, 2015 14:16 — forked from Globegitter/es.sh
cd ~
##If you want to install OpenJDK
#sudo apt-get update
#sudo apt-get install openjdk-8-jre-headless -y
###Or if you want to install Oracle JDK, which seems to have slightly better performance
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer