Skip to content

Instantly share code, notes, and snippets.

View salimhossain's full-sized avatar

Salim Hossain salimhossain

View GitHub Profile
@paultheman
paultheman / mac_keyremapping.md
Last active August 12, 2025 23:27
Guide on how to remap Keyboard keys on macOS

Guide on how to remap Keyboard keys on macOS

Update 17.10.2024: macOS 15 no longer requires root privileges for hidutil, you need to add hidutil and Terminal to 'Input Monitoring' in Settings/Privacy & Security tab.

Update 13.04.2024: On macOS 14.2 hidutil requires root privileges.

If you have a mac with an INT (ISO) keyboard you might want to change the ± key to ~. During my research I found that the information on this topic is not at all centralized. I prefer this option because it does not involve installing new software.

With macOS 10.12 Sierra Apple introduced hidutil as a tool to remap keyboard keys. See TN2450.

@denji
denji / NGINX-HTTP-Request-Stages.md
Last active May 30, 2025 08:56
NGINX HTTP Request Stages

NGINX actual HTTP Request processing flow is divided into 11 stages.

The reason for this division is to perform logical subdivision request to the module as a processing unit, the various stages can contain any number of HTTP modules and pipelined manner request.

The advantage of this is to make the process more flexible, reducing the degree of coupling.

These 11 HTTP stages are as follows:

  1. NGX_HTTP_POST_READ_PHASE ― The phase of the read request;
@zgordon
zgordon / registerblock-custom-icon-gutenberg.js
Last active January 2, 2022 19:56
Example for how to create use a custom SVG icon for a block in Gutenberg
// Import __ from i18n internationalization library
const { __ } = wp.i18n;
// Import registerBlockType() from block building libary
const { registerBlockType } = wp.blocks;
// Import the element creator function (React abstraction layer)
const el = wp.element.createElement;
/**
* Example of a custom SVG path taken from fontastic
*/
@wpscholar
wpscholar / pantheon-wp-config.php
Last active March 26, 2021 05:34
My Pantheon wp-config.php template.
<?php
define( 'SITE_LIVE_DOMAIN', SITE_LIVE_DOMAIN );
define( 'WP_ENV', isset( $_ENV['PANTHEON_ENVIRONMENT'] ) ? $_ENV['PANTHEON_ENVIRONMENT'] : 'local' );
define( 'SCHEME', isset( $_SERVER['HTTP_USER_AGENT_HTTPS'] ) && $_SERVER['HTTP_USER_AGENT_HTTPS'] == 'ON' ? 'https' : 'http' );
// Redirect all traffic on live site to the correct domain
if ( 'live' === WP_ENV && php_sapi_name() !== 'cli' ) {
if ( $_SERVER['HTTP_HOST'] !== SITE_LIVE_DOMAIN ) {
@igorbenic
igorbenic / array.php
Last active October 22, 2022 13:47
How to use the Starter Content in your WordPress Theme | http://www.ibenic.com/create-starter-content-wordpress-theme/
<?php
add_theme_support( 'starter-content', array(
// Content Section for Widgets
'widgets' => array(
// Sidebar
'sidebar-1' => array(
// Widget ID
'my_text' => array(
// Widget $id -> set when creating a Widget Class
@jazzsequence
jazzsequence / comments.php
Last active December 14, 2015 20:28
Twitter-based comment system for @dropplets
<div id="comments"></div>
<script src="http://widgets.twimg.com/j/1/widget.js"></script>
<link href="http://widgets.twimg.com/j/1/widget.css" type="text/css" rel="stylesheet">
<script>
new TWTR.Widget({
type: 'search',
search: '<?php echo $post_link ?>',
id: 'comments',
loop: false,
subject: 'Comments',
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik