Skip to content

Instantly share code, notes, and snippets.

View TMMC's full-sized avatar

TMMC TMMC

View GitHub Profile
@TMMC
TMMC / jquery.photoswipe.js
Last active December 1, 2018 20:09 — forked from kshnurov/jquery.photoswipe.js
PhotoSwipe: init from DOM using jQuery
(function( $ ) {
$.fn.photoswipe = function(options){
var galleries = [],
_options = options;
var init = function($this){
galleries = [];
$this.each(function(i, gallery){
galleries.push({
id: i,
/**
* BLOCK: wp-block-fns-blocks-page-intro (page-intro)
*/
// == Block dependencies
import classnames from 'classnames';
import blockIcons from '../icons';
import './style.scss';
import './editor.scss';
@TMMC
TMMC / photoswipe-init.js
Created January 21, 2019 21:07
Photoswipe working with `ul > li > figure > a > img` structure.
/* HTML structure:
* <ul>
* <li>
* <figure>
* <a>
* <img />
* </a>
* <figcaption></figcaption>
* <figure>
* </li>
@TMMC
TMMC / gitBash_windows.md
Created August 14, 2020 09:55 — forked from evanwill/gitBash_windows.md
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@TMMC
TMMC / empty-windows-terminal-scheme.json
Last active September 10, 2020 09:49
Empty Windows Terminal Colour Scheme template
{
"name" : "",
"foreground" : "",
"background" : "",
"cursorColor" : "",
"selectionBackground" : "",
"black" : "",
"red" : "",
"green" : "",
"yellow" : "",
@TMMC
TMMC / wordpress-code-snippets.php
Last active February 1, 2023 15:52
Wordpress code snippets
<?php
/* Add excerpt for page posty type */
add_post_type_support('page', 'excerpt');
?>
<?php
/* Add shortcode for current year */
add_shortcode('current_year', 'tmmc_current_year_shortcode');
function tmmc_current_year_shortcode() {
return date('Y');