Skip to content

Instantly share code, notes, and snippets.

View martisj's full-sized avatar
🐊

Martin Sjåstad martisj

🐊
View GitHub Profile
@BPScott
BPScott / readme.md
Last active February 7, 2024 16:16
Github suggestion: Per-organization email overrides

This totally happened, y'all can stop +1ing this now. GitHub Blog post. Direct link to settings where you can set this.


#Per-organization / per-repo email overrides - A feature suggestion

Here the concepts "organization" and "user" are interchangeable, I'm talking about an entity that owns a repo, whether it is jQuery or John Resig. I'll stick to using organization as it best represents my original use-case.

##TL;DR

@nhibberd
nhibberd / gist:9d78576aab943cdb0f6c
Created June 23, 2014 00:41
Zsh case insensitivity auto complete
## case-insensitive (uppercase from lowercase) completion
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
## case-insensitive (all) completion
#zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
## case-insensitive,partial-word and then substring completion
#zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
@addyosmani
addyosmani / package.json
Last active January 18, 2024 21:31
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@gerbenvandijk
gerbenvandijk / Mark parent navigation active when on custom post type single page
Last active January 1, 2024 21:22
Mark (highlight) custom post type parent as active item in Wordpress Navigation.When you visit a custom post type's single page, the parent menu item (the post type archive) isn't marked as active. This code solves it by comparing the slug of the current post type with the navigation items, and adds a class accordingly.
<?php
function add_current_nav_class($classes, $item) {
// Getting the current post details
global $post;
// Get post ID, if nothing found set to NULL
$id = ( isset( $post->ID ) ? get_the_ID() : NULL );
@anthonyholmes
anthonyholmes / bootstrap-sass-mixin-cheatsheet.scss
Created October 10, 2014 08:13
Bootstrap Sass Mixin Cheatsheet
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
@elijahmanor
elijahmanor / pros-cons-npmscripts-vs-gulp.md
Last active February 20, 2022 12:46
Pros and Cons of `npm scripts` vs Gulp

Comparison of npm scripts vs Gulp

npm scripts

Pros

  • npm scripts are low-level and leverage the actual library you want to use (example: "lint": "eslint ./")
  • package.json is a central place to see what scripts are available (also npm run will list all scripts)
  • When things get too complicated you can always defer to another file (example: "complex-script": "babel-node tools/complex-script.js")
  • npm scripts are more powerful than one might first think (pre/post hooks, passing arguments, config variables, chaining, piping, etc...)
@niepi
niepi / osx_php_homebrew.setup.md
Created February 28, 2012 13:23
OSX PHP Homebrew Setup

install php

with mysql pgsql intl support

$ brew install php --with-apache --with-mysql --with-pgsql --with-intl

set php timezone in php ini

date.timezone = Europe/Vienna
@stuartsierra
stuartsierra / fresh-chrome.sh
Last active October 13, 2020 16:07
Launch new instances of Google Chrome on OS X with isolated cache, cookies, and user config
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
@bentruyman
bentruyman / express-stylus.html
Created February 13, 2011 19:27
Using Stylus Middleware with Express
<!doctype html>
<html lang="en">
<head>
<title>My Web Page</title>
<meta charset="utf-8">
<link href="/stylesheets/main.css" rel="stylesheet">
</head>
<body>
</body>
</html>