Skip to content

Instantly share code, notes, and snippets.

View muradm's full-sized avatar
💭
Use as intended

Murad muradm

💭
Use as intended
View GitHub Profile
@muradm
muradm / polyfill.ts
Created January 24, 2020 21:30
Angular polyfill.ts for remote console log
import 'zone.js/dist/zone' // Angular requirement
(window as any).enableRemoteLog = () => {
(window as any).originalConsole = console
const axios = import('axios')
console = (Object.keys(console) as (keyof Console)[])
.map(k =>
typeof console[k] === 'function'
? {
[k]: (...args: any[]) => {
@muradm
muradm / grub-latest.scm
Last active February 28, 2021 19:05
grub-latest.scm
(define-module (grub-latest)
#:use-module (guix build-system gnu)
#:use-module (guix build-system trivial)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix licenses)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
@muradm
muradm / shepherd
Created March 1, 2021 17:41
shepherd starter script
#!/usr/bin/env -S guix repl --
!#
;; dynamic version of /gnu/store/....-shepherd-.../bin/shepherd
;; here we want to run shepherd with guix guile, in order
;; to be able to use (use-modules (guix ...)) in our scripts
;;
;; Why: currently guix runs with guile-3.0.5, while stock
;; shepherd is provided with guile-3.0.2. When importing modules
;; guix, it gives tones of "bytecode incompatible" warnings
@muradm
muradm / gpg-agent.scm
Created March 1, 2021 17:46
gpg-agent.scm
(use-modules (ice-9 format) (ice-9 popen) (ice-9 rdelim) (ice-9 regex)
((guix packages) #:select (package-file))
((guix store) #:select (open-connection close-connection run-with-store))
((gnu packages gnupg) #:select (gnupg pinentry-emacs)))
(define current-tty (ttyname (current-output-port)))
(define gpg-agent-description
(format #f "GnuPG PGP and SSH agent on ~a" current-tty))