Skip to content

Instantly share code, notes, and snippets.

View smalinux's full-sized avatar
🎯
FOCUS

Sohaib Mohamed smalinux

🎯
FOCUS
View GitHub Profile
@brenns10
brenns10 / Makefile
Last active August 3, 2023 19:51
Linux Character Device Example
obj-m += chardev.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@anryko
anryko / Makefile
Created March 29, 2016 20:32
Simple kernel module example. Lists process list and count.
obj-m += lkm_hello1.o
KDIR ?= /lib/modules/$(shell uname -r)/build
all:
make -C $(KDIR) M=$(PWD) modules
clean:
make -C $(KDIR) M=$(PWD) clean
@dmgerman
dmgerman / vimium-emacs.md
Created September 28, 2015 19:46
Emacs-Style Key Bindings for Vimium

My Vimium Key Bindings (Emacs-Style)

This is a full set of key bindings (as of Vimium v1.45); covering all Vimium functionality. I have tried to map all Vimium functionality to comparable Emacs functionality (whenever possible). In cases where there is no equivalent, those commands are prefixed by <c-g> (indicating <c-g>oogle Chrome; and because <c-g> does not conflict with other Emacs shortcuts at all).

Commented Shortcuts: There are a few Emacs-style shortcuts that are simply not possible in Vimium. All of my shortcuts (including those which were not possible; i.e. where I used a decent alternative) have been commented below. This should help to clarify my rationale.

_Compatibility: All of these shortcuts were tested on Mac OS X (Mavericks). Please note that all of my shortcuts operate under the assumption that your Emacs Meta key is the Alt/Option key. This really was my only choice, because the key is already used in Chrome for shortcuts that c

puts("أهلًا يا عالم!");
@richardhsu
richardhsu / git_log_first_email.sh
Created April 9, 2014 09:30
Bash script to pull git repositories, clone them, view log and grab the first email address seen.
#!/bin/bash
# Set up a repos.txt file that contains a list of all the repos
# one repo per line. Then create an emails.txt file which is where
# all the emails will go. It'll be a CSV file so you can verify.
# This is a quick hacky way to get emails, not sure if I covered all
# valid characters in regex but didn't need precision. Feel free to
# make it better!
reponame="https://github.com/[a-zA-Z0-9._-]+/([a-zA-Z0-9._-]+)$"
email="<([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.\w+)>"
@claudiosanches
claudiosanches / functions.php
Created January 22, 2014 01:17
WordPress - Get a first image attachment in post
<?php
function odin_get_first_image() {
$attachment = get_children(
array(
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'DESC',
'numberposts' => 1,
)
@blackfalcon
blackfalcon / git-feature-workflow.md
Last active April 13, 2024 07:33
Git basics - a general workflow

Git-workflow vs feature branching

When working with Git, there are two prevailing workflows are Git workflow and feature branches. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited, and the focus of this article.

If you are new to Git and Git-workflows, I suggest reading the atlassian.com Git Workflow article in addition to this as there is more detail there than presented here.

I admit, using Bash in the command line with the standard configuration leaves a bit to be desired when it comes to awareness of state. A tool that I suggest using follows these instructions on setting up GIT Bash autocompletion. This tool will assist you to better visualize the state of a branc

@pascalpoitras
pascalpoitras / config.md
Last active April 28, 2024 23:12
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@velicast
velicast / stdc++.h
Created July 17, 2013 17:56
Linux GCC 4.8.0 /bits/stdc++.h header definition.
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 4, 2024 21:33
A badass list of frontend development resources I collected over time.