Skip to content

Instantly share code, notes, and snippets.

@ibrahima
ibrahima / jemalloc_initial_exec.patch
Last active April 7, 2025 23:20
Patch for jemalloc 3.6.0 to allow it to work with newer versions of glibc
diff -ruN jemalloc-3.6.0-pristine/configure jemalloc-3.6.0-patched/configure
--- jemalloc-3.6.0-pristine/configure 2014-03-31 09:38:51.000000000 -0700
+++ jemalloc-3.6.0-patched/configure 2025-04-07 16:03:09.996708990 -0700
@@ -5079,7 +5079,7 @@
main ()
{
static __thread int
- __attribute__((tls_model("initial-exec"))) foo;
+ __attribute__((tls_model("initial-exec"), unused)) foo;
foo = 0;
@ibrahima
ibrahima / build_emacs.sh
Last active March 7, 2025 23:18
My emacs build
#!/usr/bin/env bash
# Ensure that we have libgccjit matching the default gcc version, libwebkitgtk-dev headers
./configure \
--without-compress-install \
--with-mailutils \
--with-pgtk \
--with-tree-sitter
# --with-xwidgets \ # Seems like this no longer works due to https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66068
# --with-native-compilation \ This is the default since Emacs 30

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 August 3, 2024 16:43
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