Skip to content

Instantly share code, notes, and snippets.

View intuxicated's full-sized avatar

Daniel Niknam intuxicated

View GitHub Profile
@intuxicated
intuxicated / BootstrapPaginationController.php
Last active October 16, 2019 05:45
Bootstrap pagination config for CodeIgniter
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MyController extends CI_Controller {
function MyFunction($page = 0){
$this->config->load('bootstrap_pagination');
$config = $this->config->item('pagination');
$config['base_url'] = base_url('my_uri');
{
"errors": {
"0": "تراكنش با موفقيت انجام شد",
"11": "شماره كارت نامعتبر است",
"12": "موجودي كافي نيست",
"13": "رمز نادرست است",
"14": "تعداد دفعات وارد كردن رمز بيش از حد مجاز است",
"15": "كارت نامعتبر است",
"16": "دفعات برداشت وجه بيش از حد مجاز است",
"17": "كاربر از انجام تراكنش منصرف شده است",
@intuxicated
intuxicated / cow.on.ini
Created September 23, 2016 05:20
cow proxy config for circus
[watcher:cow]
cmd = /usr/local/bin/cow
uid = danial
gid = danial
numprocesses = 1
debug = true
stdout_stream.class = FileStream
stdout_stream.filename = /var/log/circus/cow.stdout.log
stdout_stream.time_format = %Y-%m-%d %H:%M:%S
@intuxicated
intuxicated / postgresql_run.sh
Created July 6, 2016 13:19
run it services
#!/bin/sh
# Use the exec command to start the app you want to run in this container.
# Don't let the app daemonize itself.
# `/sbin/setuser memcache` runs the given command as the user `memcache`.
# If you omit that part, the command will be run as root.
# Read more here: https://github.com/phusion/baseimage-docker#adding-additional-daemons
exec /sbin/setuser postgres /usr/lib/postgresql/9.5/bin/postgres -D /usr/local/pgsql/data
<!DOCTYPE html>
<html>
<head>
<title>Sptest</title>
<link rel="stylesheet" media="all" href="/assets/links.self-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css?body=1" data-turbolinks-track="true" />
<link rel="stylesheet" media="all" href="/assets/scaffolds.self-0e337535bfad65509947bc36f19106a4d73fcef4cd922ab5cd5f57e8392ea85b.css?body=1" data-turbolinks-track="true" />
<link rel="stylesheet" media="all" href="/assets/application.self-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css?body=1" data-turbolinks-track="true" />
<script src="/assets/jquery.self-660adc51e0224b731d29f575a6f1ec167ba08ad06ed5deca4f1e8654c135bf4c.js?body=1" data-turbolinks-track="true"></script>
<script src="/assets/jquery_ujs.self-e87806d0cf4489aeb1bb7288016024e8de67fd18db693fe026fe3907581e53cd.js?body=1" data-turbolinks-track="true"></script>
@intuxicated
intuxicated / gist:5619814
Created May 21, 2013 13:36
persian html input - jquery plugin
/**
* http://bit.ly/12J93qc
*/
(function ($) {
    $.fn.farsiInput = function (options) {
        var defaults = {
            changeLanguageKey: 145 /* Scroll lock */
        };
        var options = $.extend(defaults, options);
 
@intuxicated
intuxicated / .htaccess
Created October 5, 2012 02:59
phpthumb htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ /path/to/phpThumb.php?src=../wallpapers/$1&w=200&h=355&aoe=1&q=99&zc=1
</IfModule>
@intuxicated
intuxicated / CallbackValidator.php
Created September 15, 2012 21:35
silex validator callback without object
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@intuxicated
intuxicated / PKGBUILD
Created March 23, 2015 12:49
aspell-fa PKGBUILD for Arch AUR
pkgname=aspell-fa
pkgver=0.11
pkgrel=1
pkgdesc="Farsi dictionary for aspell"
arch=('i686' 'x86_64')
url="http://aspell.net/"
license=('custom')
depends=('aspell')
source=(ftp://ftp.gnu.org/gnu/aspell/dict/fa/aspell6-fa-${pkgver}-0.tar.bz2)
md5sums=('47c8599e529fc291a096c12f0b8372ca')
server {
listen 80;
server_name localhost;
root /home/website/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {