Skip to content

Instantly share code, notes, and snippets.

View yumyo's full-sized avatar

Giulia Nicole Pernice yumyo

View GitHub Profile
@lonekorean
lonekorean / gist:1b9a17bbf235a7557a0e
Created June 10, 2015 20:39
Checkbox trickery, ordering with flexbox
.items {
display: flex;
flex-direction: column;
}
.done {
order: 1;
}
input:checked + label {
<?php
class Maera_Timber_Conditionals extends TimberCore {
public $comments_open;
public $has_tag;
public $has_term;
public $in_category;
public $is_404;
public $is_admin;
@sgnl
sgnl / add-upstream.md
Last active October 3, 2023 22:51
So you've forked a Repository and you want updates...

#tl;dr

setting up a branch to track a repo

pre: assuming you have forked a repo and cloned your fork to your computer

  1. git remote add [maintainer's name] [paste URL here]
  2. git fetch --all
  3. git branch --track [maintainer's name]_[branch] [remote name from step 1]/[branch you want to track] At this point you may watch to checkout to your newly create branch and issue a git pull command.
@nishantmodak
nishantmodak / nginx.conf.default
Last active May 7, 2025 07:58
Default Nginx Conf
#user nobody;
#Defines which Linux system user will own and run the Nginx server
worker_processes 1;
#Referes to single threaded process. Generally set to be equal to the number of CPUs or cores.
#error_log logs/error.log; #error_log logs/error.log notice;
#Specifies the file where server logs.
@grappler
grappler / functions.php
Last active September 5, 2024 01:21
// add ie conditional html5 shim to header
<?php
// add ie conditional html5 shim to header
function _s_add_ie_html5_shim () {
echo '<!--[if lt IE 9]>';
echo '<script src="' . get_template_directory_uri() . '/js/html5.js"></script>';
echo '<![endif]-->';
}
add_action('wp_head', '_s_add_ie_html5_shim');
@oilvier
oilvier / bookmark.js
Last active May 6, 2025 01:32
Javascript to add a bookmark - Cross Browser
/**
*
* Add to bookmark
* Several tests are necessary in order for this "simple" action to work in most of the browsers
*
*/
// First, we define the element where the "Add to bookmark" action will trigger
var triggerBookmark = $(".js-bookmark"); // It must be an `a` tag
@roachhd
roachhd / README.md
Last active November 19, 2020 14:56
Ode To Dan : Quick switch Themes with javascript

A simple clone of Dan Edens' blog with the day/night persistent toggle ❤️

<script>
// Toggle night theme
var d = document.documentElement,
    t = document.querySelectorAll(".js--toggle-lights")[0],
    m = localStorage.getItem("nightmode");

if(m == "true") {
@fitzhaile
fitzhaile / bem-nav.php
Last active April 17, 2017 15:26
Alternative BEM-based lib/nav.php for Roots Theme
<?php
/**
* Cleaner, BEM-based walker for wp_nav_menu()
*
* (Attempts to adhere more to http://cssguidelin.es.)
*
* NOTE: This apprroach requires substitute arguments to be passed to wp_nav_menu().
*
* 'nav_class' - Class attached to the <nav> element that contains the menu.
* It is used to generate classes for the ul, li and anchor elements. For example,
@joelstein
joelstein / _mixins.scss
Last active February 1, 2017 13:33
Horizontal list mixins
// Standard horizontal list, using word-spacing trick to remove whitespace
// between inline-block elements.
@mixin horizontal-list {
padding: 0;
text-align: center;
word-spacing: -1em;
display: table;
width: 100%;
li {
@scofennell
scofennell / sjf_deh_save_custom_meta.php
Last active June 20, 2017 16:06
WordPress function to save custom meta box for attachment posts
<?php
/**
* Save the Data
*
*/
function sjf_deh_save_custom_meta( $post_id ) {
// Check if the nonce exists.
if( ! isset( $_POST[ 'sjf_deh_custom_meta_box_nonce' ] ) ) { return $post_id; }