Skip to content

Instantly share code, notes, and snippets.

View soufianeEL's full-sized avatar

soufiane EL HAMCHI soufianeEL

View GitHub Profile
<?php
// Utilisation d'une classe Task pour clarifier mon code précédent à base de tableaux
class Task
{
protected $taskId;
protected $coroutine;
protected $sendValue = null;
protected $beforeFirstYield = true;
@soufianeEL
soufianeEL / laravel.js
Last active June 18, 2023 05:25 — forked from JeffreyWay/laravel.js
You use Laravel 5 and you want to send a DELETE request without creating a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. To use, import script, and create a link with the `data-method="DELETE"` and `data-token="{{csrf_token()}}"` attributes.
/*
Exemples :
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}">
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}" data-confirm="Are you sure?">
*/
(function() {
@benhuson
benhuson / htaccess-not-ip-redirect.txt
Last active May 15, 2019 01:26
.htaccess rules for redirecting if IP address does not match.
# Redirect other IP addresses
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Single IP Address
RewriteCond %{REMOTE_HOST} !^00.00.00.00
# Multiple IP Addresses
RewriteCond %{REMOTE_HOST} !^(00.00.00.00|00.00.00.00)
RewriteRule .* http://www.example.com/ [R=301,L]
@mamemomonga
mamemomonga / supervisord
Last active July 9, 2021 18:02 — forked from keimlink/gist:831633
/etc/rc.d/init.d/supervisord for CentOS 6
#!/bin/bash
#
# Startup script for the Supervisor server
#
# Tested with CentOS release 6.6
#
# chkconfig: 2345 85 15
# description: Supervisor is a client/server system that allows its users to \
# monitor and control a number of processes on UNIX-like \
# operating systems.
@soufianeEL
soufianeEL / kamailio.cfg
Created May 12, 2014 17:33
Kamailio.cfg with SIP over websockets support included and PostgreSQL as database engine ( Kamailio v=4.1.3 )
#!KAMAILIO
#
# Kamailio (OpenSER) SIP Server v4.1 - default configuration script
# - web: http://www.kamailio.org
# - git: http://sip-router.org
#
# Direct your questions about this file to: <sr-users@lists.sip-router.org>
#
# Refer to the Core CookBook at http://www.kamailio.org/wiki/
@zhacker98
zhacker98 / debian-kamailio-installer.sh
Last active August 29, 2015 13:57
Debian Kamailio Installer from GIT Version 4.1 (Created on Debian 7.0 x64 , but should work on all Debian Variants)
#!/bin/bash
# Created for Debian 7.0 x64 (Wheezy) but should work on any Debian Variant
blue='\e[0;34m'
NC='\e[0m' # No Color
echo -e "${blue}Installing Prerequisites Required for the installer to complete${NC}"
apt-get install -y autoconf automake devscripts gawk g++ git-core libjpeg-dev libncurses5-dev libtool make python-dev pkg-config libtiff5-dev libperl-dev libgdbm-dev libdb-dev sudo gcc flex bison libmysqlclient-dev libssl1.0.0 libcurl3 libxml2 libpcre3 gettext && \
@xeoncross
xeoncross / index.php
Created March 8, 2012 17:31
Tiny, SMTP client in PHP
<?php
/*
This is a very tiny proof-of-concept SMTP client. Currently it's over 320 characters (if the var names are compressed). Think you can build one smaller?
*/
ini_set('default_socket_timeout', 3);
$user = 'you@gmail.com';
$pass = '';
$host = 'ssl://smtp.gmail.com';
@nuxlli
nuxlli / sublime_text_2_useful_shortcuts.md
Created September 9, 2011 18:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods