Skip to content

Instantly share code, notes, and snippets.

View dmsherazi's full-sized avatar

Dost Muhammad Shah dmsherazi

View GitHub Profile
@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 -
@hu55a1n1
hu55a1n1 / Makefile
Created April 29, 2018 06:17
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 -
@hu55a1n1
hu55a1n1 / sip_speaker.py
Last active September 23, 2022 16:15
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.
#
@segunfamisa
segunfamisa / app-module-build.gradle
Last active June 22, 2020 11:43
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
@bappi-d-great
bappi-d-great / code.php
Created July 16, 2015 06:52
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;
@MartinNowak
MartinNowak / OSX-10.8.ova
Last active October 11, 2022 21:16
curl follow redirects
@probonopd
probonopd / sendandreceive.ino
Last active September 20, 2021 19:53
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…
#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 February 1, 2013 00:51
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?
#!/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 January 5, 2012 05:37
JavaScript: Convert milliseconds to object with days, hours, minutes, and seconds
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 };