Skip to content

Instantly share code, notes, and snippets.

View mazhar266's full-sized avatar
💭
I may be slow to respond.

Mazhar Ahmed mazhar266

💭
I may be slow to respond.
View GitHub Profile
@mazhar266
mazhar266 / db.php
Created March 6, 2019 04:33 — forked from seiichi/db.php
getting sqlite to work with fuelphp
// works with FuelPHP 1.4
return array(
'default' => array(
'type' => 'pdo',
'connection' => array(
'dsn' => 'sqlite:/PATH/TO/DATABASE_FILE',
'username' => '',
'password' => '',
),
'charset' => NULL, /* http://stackoverflow.com/questions/263056/how-to-change-character-encoding-of-a-pdo-sqlite-connection-in-php */
@mazhar266
mazhar266 / filter_dict.py
Last active August 9, 2018 12:41 — forked from 89465127/filter_dict.py
python 2 & 3 filter a dictionary by keys or values
d = {1:11, 2:22, 3:33}
# filter by key
d2 = {k: v for k, v in filter(lambda t: t[0] in [1, 3], d.items())}
# filter by value
d3 = {k: v for k, v in d.items() if v in [2,3]}
@mazhar266
mazhar266 / puma.service
Created August 4, 2018 07:46 — forked from arteezy/puma.service
Manage Puma with systemd on Ubuntu 16.04 and rbenv
[Unit]
Description=Puma Rails Server
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/home/deploy/app/current
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop
@mazhar266
mazhar266 / httpd.asm
Created January 11, 2018 08:10 — forked from DGivney/httpd.asm
section .text
global _start
_start:
xor eax, eax ; init eax 0
xor ebx, ebx ; init ebx 0
xor esi, esi ; init esi 0
jmp _socket ; jmp to _socket
_socket_call:
@mazhar266
mazhar266 / unijoy.sh
Last active July 18, 2017 10:14 — forked from ratulcse10/gist:d3323d0f598743ed9929
how to install unibijoy in ubuntu
sudo apt-get install ibus-m17n m17n-db m17n-contrib ibus-gtk
sudo dpkg -L m17n-db|grep bn
sudo dpkg -L m17n-contrib|grep bn
#If ibus is not installed on your system, install it by providing the following commands on terminal.
sudo apt-get install ibus
@mazhar266
mazhar266 / banglaNumber.js
Created July 14, 2017 12:18 — forked from nixon1333/banglaNumber.js
English number to Bangla number convertion
function toBangla (str)
{
//check if the `str` is not string
if(!isNaN(str)){
//if not string make it string forcefully
str = String(str);
}
//start try catch block
try {
@mazhar266
mazhar266 / kickstart.sh
Last active July 19, 2017 06:13 — forked from faisalmahmud/gist:e4c44c0dacacf01515dea1643929fcdb
Good starting point for a Django dev environment on Ubuntu
sudo apt-get update
sudo apt-get upgrade
# Install packages
sudo apt-get install -y python-pip python-dev build-essential python-software-properties
sudo apt-get install -y git-core htop nginx ntpdate nano ufw curl wget
sudo apt-get install -y zlib1g-dev libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev
sudo apt-get install -y libsqlite3-dev sqlite3
sudo apt-get install -y redis-server
sudo apt-get install -y nodejs npm
@mazhar266
mazhar266 / stuns
Created January 30, 2017 06:23 — forked from yetithefoot/stuns
STUN+TURN servers list
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},
@mazhar266
mazhar266 / stuns
Created January 30, 2017 06:22 — forked from zziuni/stuns
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@mazhar266
mazhar266 / LoginController.java
Created July 30, 2016 23:06 — forked from jewelsea/LoginController.java
JavaFX sample for an fxml based Login screen to main application transition with login session data transfer
package login;
import javafx.event.*;
import javafx.fxml.FXML;
import javafx.scene.control.*;
/** Controls the login screen */
public class LoginController {
@FXML private TextField user;
@FXML private TextField password;