Skip to content

Instantly share code, notes, and snippets.

View nfq's full-sized avatar

Nathan Querido nfq

View GitHub Profile
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active March 13, 2025 03:37
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");
@danhunsaker
danhunsaker / README.md
Last active December 15, 2019 23:38 — forked from sanderson/Environment Variables
Configuring Nanobox to Use nullmailer

nullmailer and Nanobox

Start by adding the environment variables (below) to your app, and merging the boxfile.yml entries into your own boxfile.yml. The script, here, is pulled in automatically by the git.io shortlink in the transform hook, so you don't need to add that.

Environment Variables

The values of the various evars should be provided by your SMTP service

@sanderson
sanderson / Environment Variables
Last active March 15, 2018 22:26
Configuring Nanobox to Use nullmailer
SMTP_HOST=smtp-host
SMTP_PORT=smtp-port
SMTP_USER=smtp-username
SMTP_PASS=smtp-password
SMTP_TLS=tls|ssl
SMTP_AUTH=login|plain
@taylorbryant
taylorbryant / purgecss-tailwind-gulp-example.js
Last active December 19, 2024 15:46
Use PurgeCSS with Tailwind & Gulp (Inspired by @andrewdelprete)
const atimport = require("postcss-import");
const { dest, src, task } = require("gulp");
const postcss = require("gulp-postcss");
const purgecss = require("@fullhuman/postcss-purgecss");
const tailwindcss = require("tailwindcss");
const TAILWIND_CONFIG = "./tailwind.config.js";
const SOURCE_STYLESHEET = "./src/style.css";
const DESTINATION_STYLESHEET = "./build/style.css";
@dmrty
dmrty / 1-macOS-10.12-sierra-setup.md
Last active March 17, 2018 18:09 — forked from kevinelliott/1-macOS-10.12-sierra-setup.md
macOS 10.12 Sierra Setup

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. T

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install.

Install OS X

  • Make backup
  • Download Sierra installer
  • Format USB Stick, name it Sierra
@renarsvilnis
renarsvilnis / imageHelpers.js
Last active May 31, 2017 09:05
Helper functions for calculating fit, fill dimensions of an image, rect,.. in JavaScript
export function calcFitDimensions (target, boundries, upscale = false) {
if (!target.width || !target.height || !boundries.width || !boundries.height) {
return calcCenterPosition(target, boundries);
}
let imgRatio = target.width / target.height;
let newWidth;
let newHeight;
// if image is horizontal
@mmazzarolo
mmazzarolo / RadioButton.js
Last active May 26, 2021 15:29
Simple animated stateless React-Native radio button
import React, { PropTypes } from 'react'
import { StyleSheet, TouchableOpacity } from 'react-native'
import { View } from 'react-native-animatable'
const DEFAULT_SIZE_MULTIPLIER = 0.7
const DEFAULT_OUTER_BORDER_WIDTH_MULTIPLIER = 0.2
const RadioButton = ({ size, innerColor, outerColor, isSelected, onPress, ...props }) => {
const outerStyle = {
borderColor: outerColor,
@adamthebig
adamthebig / craft.request.twig
Created February 13, 2016 18:54
Craft request cheat sheet
{# Properties #}
{{ craft.request.firstSegment }}
{{ craft.request.isAjax }}
{{ craft.request.isLivePreview }}
{{ craft.request.isSecure }}
{{ craft.request.lastSegment }}
{{ craft.request.pageNum }}
{{ craft.request.path }}
{{ craft.request.segments }}
{{ craft.request.serverName }}
@vanjacosic
vanjacosic / README.md
Created November 7, 2015 11:15
Assets in Django with gulp pipeline

Assets in Django with gulp as a pipeline

by @piquadrat and @vanjacosic from Opbeat.

This is the approach we use on Opbeat.com. In gulp it uses the gulp-asset-manifest module. In Django, it uses custom template tags to load the manifest.

We use it for JS and CSS, in this example it's some JS library files.

gulpfile.js

@bryandugan
bryandugan / Craft CMS SEO Meta.twig
Last active October 9, 2022 15:21
Craft CMS SEO Meta Tags
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="{{ siteUrl }}favicon.png">
<title>{% if homeTitle is defined %}{{ siteName }} | {{ entry.homeTitle }}{% elseif entry.title is defined %}{{ entry.title }} | {{ siteName }}{% else %}{{ title }} | {{ siteName }}{% endif %}</title>
<link rel="stylesheet" href="{{ siteUrl }}assets/css/app.css" />
<script src="{{ siteUrl }}assets/bower_components/modernizr/modernizr.js"></script>
<!-- General Page Meta -->
{% if entry.seoDescription is defined %}
{% if entry.seoDescription is not empty %}