Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 9, 2025 19:05
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@marcedwards
marcedwards / high-dpi-media.css
Last active March 2, 2025 20:24
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@callmephilip
callmephilip / gist:3519403
Created August 29, 2012 21:52
[JavaScript] Dispatching keyboard event
// gecko and webkit
// details here https://developer.mozilla.org/en-US/docs/DOM/event.initKeyEvent
var keyboardEvent = document.createEvent("KeyboardEvent");
var initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? "initKeyboardEvent" : "initKeyEvent";
keyboardEvent[initMethod](
"keydown", // event type : keydown, keyup, keypress
true, // bubbles
@hbsnow
hbsnow / CheckBrowser.class.php
Last active November 14, 2016 02:13
PHPでブラウザを振り分けるクラス。振り分けそのものはそこまで厳密なものではなく、IEをのぞくほとんどのブラウザのユーザは常に最新のブラウザを使用していると想定している。
<?php
/**
* ブラウザをゆるく判別
*
* @version 1.2.2
*/
class CheckBrowser
{
@cyokodog
cyokodog / 01_readme.md
Last active July 7, 2020 09:17
シンプルなテーブルフィルター jQuery プラグイン

jQuery Simple Table Filter

シンプルなテーブルフィルター jQuery プラグイン。

##使い方

フィルタ条件の入力フィールド

テキストフィールド、ラジオボタン、プルダウンメニューに対応します。

@aolde
aolde / static_server.js
Last active June 11, 2025 02:42 — forked from ryanflorence/static_server.js
Simple web server in Node.js. This fork added mime types for common file types.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888,
mimeTypes = {
"html": "text/html",
"jpeg": "image/jpeg",
"jpg": "image/jpeg",
"png": "image/png",
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 6, 2025 08:17
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@leipert
leipert / detectBrowserLanguage.js
Last active March 11, 2024 02:10 — forked from anonymous/detectBrowserLanguage.js
Detect browser language in javascript (utilizing lodash)
// These window.navigator contain language information
// 1. languages -> Array of preferred languages (eg ["en-US", "zh-CN", "ja-JP"]) Firefox^32, Chrome^32
// 2. language -> Preferred language as String (eg "en-US") Firefox^5, IE^11, Safari,
// Chrome sends Browser UI language
// 3. browserLanguage -> UI Language of IE
// 4. userLanguage -> Language of Windows Regional Options
// 5. systemLanguage -> UI Language of Windows
var browserLanguagePropertyKeys = ['languages', 'language', 'browserLanguage', 'userLanguage', 'systemLanguage'];
@andrewmilson
andrewmilson / file-upload-multipart.go
Last active June 28, 2025 18:41
Golang multipart/form-data File Upload
package main
import (
"net/http"
"os"
"bytes"
"path"
"path/filepath"
"mime/multipart"
"io"
@subfuzion
subfuzion / github-wiki-how-to.md
Last active June 17, 2025 04:08
GitHub Wiki How-To

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: [email protected]:myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https).

You make edits, and commit and push your changes, like any normal repo. This wiki repo is distinct from any clone of the project repo (the repo without wiki.get appended).

How do I add images to a wiki page?