Skip to content

Instantly share code, notes, and snippets.

View dmsherazi's full-sized avatar

Dost Muhammad Shah dmsherazi

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
/**
* Continents and Countries MySQL Tables compiled from Wikipedia, Braintree Payments documentation
* and a couple other places I don't recall at the moment. This data is compatible with the Braintree
* Payment API as of Dec 2011
*
* Compiled by Steve Kamerman, 2011
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
@dmsherazi
dmsherazi / sim900.mdown
Created November 23, 2015 09:42 — forked from tegila/sim900.mdown
SIM900 TIPS AND TRICKS

TUTORIAL

Attach to GPRS Service

-> AT+CGATT = 1
<- OK

Define PDP Context (cid, PDP type, APN)

-&gt; AT+CGDCONT=1,"IP","zap.vivo.com.br"
@dmsherazi
dmsherazi / SimpleMqttClient.java
Created February 23, 2016 11:36 — forked from m2mIO-gister/SimpleMqttClient.java
Example MQTT Messaging in Java
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.MqttTopic;
public class SimpleMqttClient implements MqttCallback {
@dmsherazi
dmsherazi / Schema.php
Created April 11, 2016 09:49 — forked from tournasdim/Schema.php
A list of Laravel's Schema commands (Laravel 4)
<?php
Schema::create('users' , function($table)
{
$table->increments('id'); Incrementing ID to the table (primary key).
$table->string('email'); VARCHAR equivalent column
$table->string('name', 100); VARCHAR equivalent with a length
$table->integer('votes'); INTEGER equivalent to the table
@dmsherazi
dmsherazi / sip_speaker.py
Created October 21, 2016 10:42 — forked from hu55a1n1/sip_speaker.py
PJSIP: Play incoming call on audio device in python
#!/usr/bin/python
#
#
# Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@dmsherazi
dmsherazi / app-module-build.gradle
Created January 2, 2017 14:10 — forked from segunfamisa/app-module-build.gradle
Using gradle extra properties to manage Android dependency versioning
// app module build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
applicationId "com.segunfamisa.gradleextraproperties"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
@dmsherazi
dmsherazi / code.php
Created February 21, 2017 12:24 — forked from bappi-d-great/code.php
current_user_on_membership function for membership 2
<?php
if( ! function_exists( 'current_user_on_membership' ) ) {
function current_user_on_membership( $membership_id ) {
$member = MS_Model_Member::get_current_member();
$membership_items = $member->get_membership_ids();
if( in_array( $membership_id, $membership_items ) ) {
return true;
}
return false;
@dmsherazi
dmsherazi / Makefile
Created October 18, 2018 11:27 — forked from hu55a1n1/Makefile
OpenWrt Makefile for Amfeltec Piranha USB FXO
#
# Copyright (C) 2014 - 2018 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# make package/feeds/telephony/amfeltec_usb/compile -j1 V=s
#
# Patch downloaded sources:
# Makefile -
@dmsherazi
dmsherazi / dumb-ap-wired-link.sh
Created March 12, 2019 13:50 — forked from braian87b/dumb-ap-wired-link.sh
How to setup a Dumb AP, Wired backbone for OpenWRT / LEDE