Skip to content

Instantly share code, notes, and snippets.

View ultimateprogramer's full-sized avatar

Ahmed Maawy ultimateprogramer

View GitHub Profile
@ultimateprogramer
ultimateprogramer / BlogController.php
Created June 29, 2016 18:54 — forked from tobysteward/BlogController.php
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
[supervisord]
nodaemon=true
loglevel=debug
[program:amon]
command=gunicorn -c gunicorn.conf.py wsgi
directory=/amon
autostart=true
autorestart=true
redirect_stderr=true
@ultimateprogramer
ultimateprogramer / ApiController.php
Created April 15, 2016 11:58 — forked from atrakeur/ApiController.php
An laravel's style implementation of API handler.
<?php
/*************************************************
* API base controller for laravel
*************************************************/
class ApiController extends Controller {
/**
* Create a json Response including errors and no data
* @param array $errors the errors
* @return responce The responce including error data
@ultimateprogramer
ultimateprogramer / nodejs-tcp-example.js
Created March 6, 2016 19:59 — forked from tedmiston/nodejs-tcp-example.js
Node.js tcp client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@ultimateprogramer
ultimateprogramer / CustomRequest.java
Created October 20, 2015 08:41
CustomRequest is a way to solve the Volley's JSONObjectReuqest cant post paramsters like the StringRequest
package com.greenchiu.nets;
import java.io.UnsupportedEncodingException;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
@ultimateprogramer
ultimateprogramer / .htaccess
Created September 29, 2015 14:38
CI: Simple .htaccess using mod_rewrite for CodeIgniter
<IfModule mod_rewrite.c>
RewriteEngine On
# !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
# slashes.
# If your page resides at
# http://www.example.com/mypage/test1
# then use
# RewriteBase /mypage/test1/
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
#!/usr/bin/env python
# encoding=utf-8
'''
formhub data importer
Automates the submission of formhub XForms from a CSV file,
possibly an export from another formhub form.
Launch with `bulk` argument to trigger bulk submission behavior (only