Skip to content

Instantly share code, notes, and snippets.

View joshbuchea's full-sized avatar

Josh Buchea joshbuchea

View GitHub Profile
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@narainsagar
narainsagar / nodejs - get filesize in readable format.md
Last active January 14, 2022 05:33
node.js - function to get file and convert the file size in humanly readable format.

node.js - get the filesize in human readable format.

This will take filePath as a function parameter and reads the file via fs module and get the file and converts it's size into more humanly readable format.

const fs = require('fs');
function getFileSize(filename) {
  const stats = fs.statSync(filename);
  //console.log('stats', stats);
 const {size} = stats;
@zcorpan
zcorpan / htmlquiz-iframe-escape.md
Last active September 20, 2016 15:51
#HTMLQuiz what happens (iframe escape)

#HTMLQuiz what happens?

<iframe id=x></iframe>
<script>
x.contentDocument.body.appendChild(x);
</script>
  • wild DOMException appears
  • iframe escapes
@knowbody
knowbody / RNfontWeights.js
Created July 14, 2016 13:42
React Native Font Weight Cheatsheet iOS
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black
@mor10
mor10 / functions.php
Created July 11, 2016 20:14
Alternative method for adding parent theme stylesheet to WordPress child theme
<?php
// Enqueue the parent theme stylesheet, then the child theme stylesheet.
// Used in place of @import rule in child theme style.css
function child_theme_name_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'parent-style' ) );
}
add_action( 'wp_enqueue_scripts', 'child_theme_name_enqueue_styles' );
@mor10
mor10 / style.css
Last active January 22, 2018 04:53
WordPress child theme setup based on the Twenty Sixteen parent theme
/*
Theme Name: Twenty Sixteen Child Theme
Theme URI: https://2016.wpcampus.org/schedule/wordpress-masterclass/
Description: A Twenty Sixteen child theme
Author: Morten Rand-Hendriksen
Author URI: https://lynda.com/mor10
Template: twentysixteen
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@noelboss
noelboss / git-deployment.md
Last active April 25, 2024 10:38
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@cvan
cvan / HOWTO.md
Last active March 20, 2024 17:56
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
@subfuzion
subfuzion / github-wiki-how-to.md
Last active April 20, 2024 09:22
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: git@github.com: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?