Skip to content

Instantly share code, notes, and snippets.

@ibrahima
ibrahima / build_emacs.sh
Last active November 9, 2023 06:40
My emacs build
#!/usr/bin/env bash
# Ensure that we have libjansson, libgccjit matching the default gcc version, libwebkitgtk-dev headers
./configure --without-compres-install --with-native-compilation --with-json --with-mailutils --with-xwidgets --with-pgtk --with-tree-sitter
make
sudo make install

Keybase proof

I hereby claim:

  • I am ibrahima on github.
  • I am ibrahimawwal (https://keybase.io/ibrahimawwal) on keybase.
  • I have a public key ASBD2RZNKXu8JQCAb75RFwZYENUPxqne3OyORUkF8v9VDwo

To claim this, I am signing this object:

@ibrahima
ibrahima / pre-commit
Last active August 9, 2018 19:03 — forked from jamtur01/pre-commit
A Terraform validation and formatting pre-commit hook
#!/usr/bin/env bash
set -e
# Formats any *.tf files according to the hashicorp convention
files=$(git diff --cached --name-only --diff-filter=d)
for f in $files
do
if [ -e "$f" ] && [[ $f == *.tf ]]; then
terraform fmt -check=true $f
fi
@ibrahima
ibrahima / CodeBlock.jsx
Last active December 3, 2020 10:23
Syntax highlighting for react-markdown
import React from 'react';
import PropTypes from 'prop-types';
import SyntaxHighlighter from 'react-syntax-highlighter';
export default class CodeBlock extends React.PureComponent {
static propTypes = {
value: PropTypes.string.isRequired,
language: PropTypes.string,
}
@ibrahima
ibrahima / sample.html.slim
Created July 28, 2016 22:30
A sample slim template that causes slim-lint to report errors on the wrong lines
- provide :title, 'Title'
- provide :viewport, 'desktop'
= render 'partials/sidebar'
- action_bar do
div.action-bar-label
= fa_icon('spinner', class: 'fa-spin')
| Loading...
(defun flycheck-fix-css-property-sort-order ()
"Fixes SCSS-lint property sort order errors in the current buffer."
(interactive)
(cl-loop for error in flycheck-current-errors
do
(fix-css-property-order error))
)
(defun correct-property-order (err)
"Extracts correct CSS property order out of ERR."
(defun goto-student-feedback ()
(interactive)
(string-match
(rx (group "hw" digit) (any ascii) (group "cs30f" (1+ alpha)))
(buffer-file-name))
(let* (
(hwnum (match-string 1 (buffer-file-name)))
(username (match-string 2 (buffer-file-name)))
(feedback-path (concat "/home/linux/ieng6/cs30f/public/" hwnum "_feedback/style_feedback_" username))
@ibrahima
ibrahima / dash-listen-3.py
Last active July 14, 2017 17:36
Amazon Dash Button ARP listener script (not written by me)
import socket
import struct
import binascii
# Written by Bob Steinbeiser (https://medium.com/@xtalker)
rawSocket = socket.socket(socket.AF_PACKET, socket.SOCK_RAW,
socket.htons(0x0003))
MAC = '74c24671971c'
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=JZO54K
ro.build.display.id=JZO54K.N8010XXUCMK2
ro.build.version.incremental=N8010XXUCMK2
ro.build.version.sdk=16
ro.build.version.codename=REL
ro.build.version.release=4.1.2
ro.build.date=Wed Nov 20 16:29:39 KST 2013
ro.build.date.utc=1384932579
E/use-Rlog/RLOG-RILD( 300): **RIL Daemon Started**
E/use-Rlog/RLOG-RILD( 300): **RILd param count=1**
E/use-Rlog/RLOG-RIL( 311): loadOpnameStaticTable(): count(1101)
E/use-Rlog/RLOG-RIL( 311): OemInitGprsData()
E/use-Rlog/RLOG-RIL( 311): deactivate_virtual_inet()
E/use-Rlog/RLOG-RIL( 311): deactivate_virtual_inet() : unknown pdp type () down all interface
E/use-Rlog/RLOG-RIL( 311): setting addr for rmnet0: 0
E/use-Rlog/RLOG-RIL( 311): intfconf_set_flags()
E/use-Rlog/RLOG-RIL( 311): intfconf_clear_addr_ipv6()
E/use-Rlog/RLOG-RIL( 311): intfconf_init_ifr_ipv6()