Skip to content

Instantly share code, notes, and snippets.

@burhanloey
burhanloey / favorite_surah.txt
Created March 4, 2019 13:29
Favorite surah from each qari
Sheikh Mishary Rashid - Ta Ha, Al Baqarah, Yasin
Omar Hisham Al Arabi - Al Insan, Maryam (new style)
Sheikh Saad Al Ghamdi - Al Isra'
@burhanloey
burhanloey / remove_whitespaces.txt
Last active February 22, 2019 07:54
Removes spaces and tabs at the end of lines
sed -i 's/[[:blank:]]*$//' file
@burhanloey
burhanloey / play.sh
Created January 24, 2019 02:06
A script to play a video using OMXPlayer with black frame and centered subtitle in Raspberry Pi
#!/usr/bin/env sh
omxplayer -o hdmi $1 --align center --blank
import java.util.Scanner;
/**
* Solution for an exercise with the question:
*
* Write a program in Java called Marks, which prompts user for the number of marks, reads it from the keyboard, and
* saves it in an int variable called numOfMarks. It then prompts user for the marks and saves them in an int array
* called marks. Your program shall check that the marks value is between 0 and 100 and the number of marks is
* between 1 to 30. The program should display number of marks that are more than 50. An example of output is shown
* below:
@burhanloey
burhanloey / buddy_async_middleware.clj
Last active May 31, 2018 22:51
Example of code implementing buddy middleware for async handlers
(ns myapp.buddy-async-middleware
(:require [buddy.auth.accessrules :refer [compile-access-rules success?
handle-error error]]
[buddy.auth.middleware :refer [authentication-request
authorization-error]]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; wrap-access-rules
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@burhanloey
burhanloey / twitch_reddit_api.txt
Created April 3, 2018 15:31
Twitch and Reddit API
Check if Twitch channel is live:
GET: https://api.twitch.tv/kraken/streams/mckentucky
-H 'Client-ID: <client_id>'
Check newest post in subreddit
GET: https://api.reddit.com/r/jombelajarjava/new?limit=3
@burhanloey
burhanloey / app-state.cljs
Created November 2, 2017 08:09
Reagent component to display app-state
(defn log []
[:pre [:code (with-out-str (cljs.pprint/pprint @app-state))]])
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi
@burhanloey
burhanloey / hello-ccl.lisp
Created August 8, 2017 13:29
Creating executables from different Common Lisp implementation
(defun main ()
(format t "Hello World!~%"))
(save-application "hello-ccl" :toplevel-function #'main :prepend-kernel t)
@burhanloey
burhanloey / emacs-in-terminal.txt
Last active August 7, 2017 12:06
Instructions to open Emacs in terminal using the same colors as Emacs GUI
This is for xfce4-terminal.
Shortcuts:
Ctrl+Alt+t - Open terminal
Ctrl+Shift+t - Open new tab
Ctrl+PgUp/PgDown - Switch tab
Ctrl+Shift+w - Close tab
To make terminal uses 256-color mode, type:
export TERM=xterm-256color