Skip to content

Instantly share code, notes, and snippets.

Muammar El Khatib muammar

View GitHub Profile
@muammar
muammar / xournal.rb
Last active Oct 16, 2018
Build Xournal with Homebrew (works with Mojave)
View xournal.rb
require 'formula'
class Xournal < Formula
homepage 'http://xournal.sourceforge.net'
url 'http://downloads.sourceforge.net/xournal/xournal-0.4.8.2016.tar.gz'
sha256 'b25898dbd7a149507f37a16769202d69fbebd4a000d766923bbd32c5c7462826'
depends_on 'pkg-config' => :build
depends_on 'autoconf' => :build
depends_on 'automake' => :build
@muammar
muammar / cholesky_d.f
Created Nov 3, 2017 — forked from t-nissie/cholesky_d.f
Cholesky decomposition written in Fortran
View cholesky_d.f
! cholesky_d.f -*-f90-*-
! Using Cholesky decomposition, cholesky_d.f solve a linear equation Ax=b,
! where A is a n by n positive definite real symmetric matrix, x and b are
! real*8 vectors length n.
!
! Time-stamp: <2015-06-25 18:05:47 takeshi>
! Author: Takeshi NISHIMATSU
! Licence: GPLv3
!
! [1] A = G tG, where G is a lower triangular matrix and tG is transpose of G.
View keybase.md

Keybase proof

I hereby claim:

  • I am muammar on github.
  • I am muammar (https://keybase.io/muammar) on keybase.
  • I have a public key ASDRSip-10FBmj_GyH-fNaDq4sCS4xelD2PeaQ-PDb0FuQo

To claim this, I am signing this object:

View qt5.patch
--- a/qttools/src/macdeployqt/shared/shared.cpp
+++ b/qttools/src/macdeployqt/shared/shared.cpp
@@ -803,6 +803,10 @@ void changeInstallName(const QString &bundlePath, const FrameworkInfo &framework
deployedInstallName = framework.deployedInstallName;
}
changeInstallName(framework.installName, deployedInstallName, binary);
+ QString canonicalInstallName = QFileInfo(framework.installName).canonicalFilePath();
+ if (canonicalInstallName != framework.installName) {
+ changeInstallName(canonicalInstallName, deployedInstallName, binary);
+ }
@muammar
muammar / # ffmpeg - 2016-09-17_15-30-00.txt
Created Sep 17, 2016
ffmpeg on Mac OS X 10.11.6 - Homebrew build logs
View # ffmpeg - 2016-09-17_15-30-00.txt
Homebrew build logs for ffmpeg on Mac OS X 10.11.6
Build date: 2016-09-17 15:30:00
@muammar
muammar / gist:255d40e4a4f48337d8dcb688d6c2a164
Created Aug 24, 2016 — forked from mharsch/gist:5144208
transcode video streams using node.js Streams and avconv (aka ffmpeg)
View gist:255d40e4a4f48337d8dcb688d6c2a164

The avconv utility can be made to work in 'the Unix way' by specifying stdin and/or stdout instead of filenames for the input and output respectively. See: http://libav.org/avconv.html#pipe

Example:

cat input.ts | avconv -i pipe:0 -f mp4 -movflags frag_keyframe pipe:1 | cat > output.mp4

Using node's require('child_process').spawn(), we can pipe streams of video data through avconv's stdin and stdout and thus Stream All The Things.

var fs = require('fs');
@muammar
muammar / getnetworkip.py
Created Aug 24, 2016
Methods to obtain IP address of physical devices
View getnetworkip.py
# Source: http://stackoverflow.com/questions/166506/finding-local-ip-addresses-using-pythons-stdlib
def getNetworkIp():
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
s.connect(('<broadcast>', 0))
return s.getsockname()[0]
print (getNetworkIp())
@muammar
muammar / sp
Created Aug 21, 2016 — forked from streetturtle/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
View sp
#!/bin/bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@muammar
muammar / mtrack.conf
Created Aug 13, 2016 — forked from snarlysodboxer/mtrak.conf
A config for Macbook Pro trackpad in mtrak in Ubuntu. https://github.com/BlueDragonX/xf86-input-mtrack/
View mtrack.conf
Section "InputClass"
MatchIsTouchpad "on"
Identifier "Touchpads"
Driver "mtrack"
# TrackpadDisable - Disables trackpad touch input. A value of 0 will enable the trackpad. A value of 1 will disable tapping and gestures but not movement. A value of 2 will disable all input. A value of 3 will also disable physical buttons. Integer. Default is 0.
# Sensitivity - Adjusts the sensitivity (movement speed) of the touchpad. This is a real number greater than or equal to zero. Default is 1. A value of 0 will disable pointer movement.
Option "Sensitivity" "0.65"
# FingerHigh - Defines the pressure at which a finger is detected as a touch. This is a percentage represented as an integer. Default is 5.
Option "FingerHigh" "12"
# FingerLow - Defines the pressure at which a finger is detected as a release. This is a percentage represented as an integer. Default is 5.
View gist:6444f3c269280ca12d243cd49488d9a7
for DIR in $(find ./ -type d); do
(
echo "<html>\n<body>\n<h1>Directory listing</h1>\n<hr/>\n<pre>"
ls -1pa "${DIR}" | grep -v "^\./$" | grep -v "^index\.html$" | awk '{ printf "<a href=\"%s\">%s</a>\n",$1,$1 }'
echo "</pre>\n</body>\n</html>"
) > "${DIR}/index.html"
done
You can’t perform that action at this time.