Skip to content

Instantly share code, notes, and snippets.

View jasperf's full-sized avatar
🏠
Working from home

Jasper Frumau jasperf

🏠
Working from home
View GitHub Profile
@khalidahmada
khalidahmada / wp-mailhog-config-smtp.php
Created August 10, 2018 11:14
Config Wordpress SMTP for MailHog - test your emails local
/*
* Add the MailHog to your wordpress projects
* By Khalid Ahmada
* MailHog @see https://github.com/mailhog/MailHog
*/
class WP_MAILHOG
{
function __construct()
@mul14
mul14 / index.js
Created July 25, 2018 14:29
JavaScript DocBlock Cheat Sheet
/**
* Description of this function.
*
* @param {string} name
* @param {Date} birthday
* @param {boolean=} isMarried Optional parameter.
* @param {string|null} [bloodType]
* @param {number=} [weight=0] Optional parameter with default value.
* @param {string[]} favoriteFoods Array of String.
*
@deepesh141291
deepesh141291 / index.html
Created July 15, 2018 04:51
Lazy Loading CSS Background Images with Intersection Observer
<div class="wrapper">
<div class="lazy-background img"></div>
<div class="lazy-background img"></div>
<div class="lazy-background img"></div>
<div class="lazy-background img"></div>
<div class="lazy-background img"></div>
</div>
@alvesoaj
alvesoaj / font-awesome-overwrite.scss
Last active December 31, 2021 08:47
Font Awesome overwrite to set the correct font path in Ruby On Rails and work in Production
/*!
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/
@import "font-awesome/scss/variables";
/* FONT PATH VARIABLE
* -------------------------- */
$fa-font-path: "font-awesome/fonts/";
/* -------------------------- */
@frank-dspeed
frank-dspeed / create_sftp_user.sh
Last active February 28, 2018 07:20
Setup SFTP Only users
#!/bin/bash
#Setup SFTP Group and Service
function setup(){
#Create sftpusers group.
sudo groupadd sftpusers
#Comment out setting disabling SFTP access from sshd config file.
sudo sed -i "s/Subsystem sftp \/usr\/lib\/openssh\/sftp-server/#Subsystem sftp \/usr\/lib\/openssh\/sftp-server/" /etc/ssh/sshd_config
@welcoMattic
welcoMattic / imagemin.md
Last active February 15, 2022 20:58
How to fix `Error: spawn ./node_modules/jpegtran-bin/vendor/jpegtran ENOENT` error for imagemin

If you're trying to run imagemin (from grunt or gulp or anything else) on Alpine, you certainly had to meet this error :

Error: spawn /YOUR_PROJECT_PATH/node_modules/jpegtran-bin/vendor/jpegtran ENOENT or the same with optipng or gifsicle instead of jpegtran.

Here's how to solve it.

First you need to install on Alpine missing package used to compile jpegtran, gifsicle and optipng binaries. Those packages are (at least):

autoconf automake file build-base nasm musl libpng-dev zlib-dev

@smutek
smutek / content-page.blade.php
Last active February 16, 2022 16:11
Simple Sage 9 Slider with Slick
@php(the_content())
@if($images)
@include('partials/slider')
@endif
@adamwathan
adamwathan / troubleshooting.md
Last active January 19, 2021 04:14
Troubleshooting Valet on macOS Sierra

Troubleshooting Valet on Sierra

Common Problems

Problem: I just see "It works!"

Apache is running on port 80 and interfering with Valet.

  1. Stop Apache: sudo /usr/sbin/apachectl stop
  2. Restart Valet: valet restart
@ramsey
ramsey / google-font-download-woff2.php
Created September 13, 2016 17:08
Downloads the .woff2 formats of the specified Google Font for the specified language types. This also creates the appropriate CSS for the downloaded font files
<?php
/**
* Downloads the .woff2 formats of the specified Google Font for the specified
* language types. This also creates the appropriate CSS for the downloaded
* font files
*
* Usage:
* php google-font-download.php 'Open Sans' ['latin-ext,latin' [/path/to/write/to]]
*/
@gareth-gillman
gareth-gillman / functions.php
Created August 27, 2016 13:20
WordPress Plugin Template Include
add_filter('template_include', 'my_function_name', PHP_INT_MAX, 2 );
function my_function_name( $template ) {
if(is_page('about')){
$template = dirname( __FILE__ ) . '/templates/about.php';
}
return $template;
}