Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Dost Muhammad Shah dmsherazi

💭
I may be slow to respond.
View GitHub Profile
@dmsherazi
dmsherazi / Makefile
Created Oct 18, 2018 — forked from hu55a1n1/Makefile
OpenWrt Makefile for Amfeltec Piranha USB FXO
View Makefile
#
# 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 -
@hu55a1n1
hu55a1n1 / Makefile
Created Apr 29, 2018
OpenWrt Makefile for Amfeltec Piranha USB FXO
View Makefile
#
# 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 -
@hu55a1n1
hu55a1n1 / sip_speaker.py
Last active Aug 2, 2021
PJSIP: Play incoming call on audio device in python
View sip_speaker.py
#!/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.
#
@segunfamisa
segunfamisa / app-module-build.gradle
Last active Jun 22, 2020
Using gradle extra properties to manage Android dependency versioning
View app-module-build.gradle
// 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
@bappi-d-great
bappi-d-great / code.php
Created Jul 16, 2015
current_user_on_membership function for membership 2
View code.php
<?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;
@probonopd
probonopd / sendandreceive.ino
Last active Sep 20, 2021
Send Pronto Hex via an IR LED connected to Arduino Pin D9. Make sure you do not send a blank (" ") as the last character. Applied fix for Leonardo from https://github.com/probonopd/arduino-infrared-pronto/pull/1 to sendandreceive.ino -- TODO: Fix sendRaw to specify length as "sizeof(signal)/sizeof(int)" as in http://forum.arduino.cc/index.php?PH…
View sendandreceive.ino
#include <IRremote.h>
// http://www.pjrc.com/teensy/td_libs_IRremote.html
// If one keypress results in multiple codes being output, then
// change in IRremoteInt.h:
// #define _GAP 50000
int RECV_PIN = 8;
IRrecv irrecv(RECV_PIN);
decode_results results;
@nddrylliog
nddrylliog / android_configure.sh
Created Feb 1, 2013
Cross-compile autotools library for Android / arm-linux-androideabi I stick that in ~/bin/, chmod +x, and then run it in place of "./configure" in my project. Then a make and make install later, the prefix contains libraries built for android. Neato eh?
View android_configure.sh
#!/bin/sh
# I put all my dev stuff in here
export DEV_PREFIX=$HOME/Dev/
# Don't forget to adjust this to your NDK path
export ANDROID_NDK=${DEV_PREFIX}/android-ndk-r8d/
export CROSS_COMPILE=arm-linux-androideabi
@remino
remino / msconvert.js
Created Jan 5, 2012
JavaScript: Convert milliseconds to object with days, hours, minutes, and seconds
View msconvert.js
function convertMS(ms) {
var d, h, m, s;
s = Math.floor(ms / 1000);
m = Math.floor(s / 60);
s = s % 60;
h = Math.floor(m / 60);
m = m % 60;
d = Math.floor(h / 24);
h = h % 24;
return { d: d, h: h, m: m, s: s };