Skip to content

Instantly share code, notes, and snippets.

View zachakbar's full-sized avatar
πŸ‘»
...

{...} zachakbar

πŸ‘»
...
View GitHub Profile
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active April 11, 2025 08:17
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@james2doyle
james2doyle / browser-body-class.php
Last active January 30, 2020 22:01
Add a custom body class to WordPress for the current browser being used. No external frameworks or plugins.
<?php
function custom_body_classes($classes)
{
// the list of WordPress global browser checks
// https://codex.wordpress.org/Global_Variables#Browser_Detection_Booleans
$browsers = ['is_iphone', 'is_chrome', 'is_safari', 'is_NS4', 'is_opera', 'is_macIE', 'is_winIE', 'is_gecko', 'is_lynx', 'is_IE', 'is_edge'];
// check the globals to see if the browser is in there and return a string with the match
$classes[] = join(' ', array_filter($browsers, function ($browser) {
@mandiwise
mandiwise / Update remote repo
Last active March 22, 2025 05:41
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@khromov
khromov / file.php
Last active January 29, 2019 21:24
Advanced Custom Fields get_field() sanitization
<?php
/**
* Helper function to get sanitized field
* and also normalize values.
*
* @param $field_key
* @param bool $post_id
* @param bool $format_value
* @param string $sanitization_method esc_html / esc_attr or NULL for none
* @return array|bool|string
@omgmog
omgmog / parallax-scroll.js
Created October 28, 2013 15:26
Simple parallax background scrolling with jQuery
$(function() {
var $el = $('.parallax-background');
$(window).on('scroll', function () {
var scroll = $(document).scrollTop();
$el.css({
'background-position':'50% '+(-.4*scroll)+'px'
});
});
});
@digitaljhelms
digitaljhelms / gist:4287848
Last active April 19, 2025 04:48
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@ancestral
ancestral / ASCII JS Keyboard Map
Created July 6, 2012 04:33
ASCII keyboard map for JavaScript keycodes (Mac)
/*
* JavaScript Keyboard Map (Mac layout)
*
*
* escβ€”β€” F1β€”β€”β€” F2β€”β€”β€” F3β€”β€”β€” F4β€”β€”β€” F5β€”β€”β€” F6β€”β€”β€” F7β€”β€”β€” F8β€”β€”β€” F9β€”β€”β€” F10β€”β€” F11β€”β€” F12β€”β€” F13β€”β€”β€”β€”β€”+
* | 27 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | ??? |
* ` β€”β€”β€” 1β€”β€”β€”β€” 2β€”β€”β€”β€” 3β€”β€”β€”β€” 4β€”β€”β€”β€” 5β€”β€”β€”β€” 6β€”β€”β€”β€” 7β€”β€”β€”β€” 8β€”β€”β€”β€” 9β€”β€”β€”β€” 0β€”β€”β€”β€” - β€”β€”β€” = β€”β€”β€” deleteβ€”β€”+
* | 192 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
* tabβ€”β€”β€”β€” Qβ€”β€”β€”β€” Wβ€”β€”β€”β€” Eβ€”β€”β€”β€” Rβ€”β€”β€”β€” Tβ€”β€”β€”β€” Yβ€”β€”β€”β€” Uβ€”β€”β€”β€” Iβ€”β€”β€”β€” Oβ€”β€”β€”β€” Pβ€”β€”β€”β€” [ β€”β€”β€” ] β€”β€”β€” \ β€”β€”β€”β€”+
* | 9 | 81 | 87 | 69 | 82 | 84 | 89 | 85 | 73 | 79 | 80 | 219 | 221 | 220 |
@kevinSuttle
kevinSuttle / meta-tags.md
Last active April 9, 2025 13:51 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags