Skip to content

Instantly share code, notes, and snippets.

View ockam's full-sized avatar

Pierre Lemieux ockam

View GitHub Profile
@ockam
ockam / useUserReducer.ts
Created September 29, 2020 17:01 — forked from schettino/useUserReducer.ts
Better Reducers with React and Typescript 3.4
import { useReducer } from 'react'
export function updateName(name: string) {
return <const>{
type: 'UPDATE_NAME',
name
}
}
export function addPoints(points: number) {
@ockam
ockam / webpack.mix.js
Created November 22, 2017 21:16 — forked from andrewdelprete/webpack.mix.js
Laravel Mix: Tailwind CSS + PurgeCSS Example
let mix = require("laravel-mix");
let tailwindcss = require("tailwindcss");
let glob = require("glob-all");
let PurgecssPlugin = require("purgecss-webpack-plugin");
/**
* Custom PurgeCSS Extractor
* https://github.com/FullHuman/purgecss
* https://github.com/FullHuman/purgecss-webpack-plugin
*/
@ockam
ockam / img.html
Created December 15, 2016 18:10 — forked from brettburwell/img.html
Craft macro to centralize the markup and config for responsive images
{# ================================================================== #}
{# ================================================================== #}
{# Responsive Images
{# ================================================================== #}
{# ================================================================== #}
{#
{% import '_macros/img' as macroImg %}
Macro to centralize the markup and config for responsive images.
@ockam
ockam / craft-cms-language-toggle.html
Last active February 17, 2016 22:03 — forked from ademers/craft-cms-language-toggle.html
Craft CMS: Language Toggle
{# Language switcher #}
{# Loop through all of the site locales, except the current one #}
{% set otherLocales = craft.i18n.getSiteLocaleIds()|without(craft.locale) %}
{% for locale in otherLocales %}
{# Is this an entry page? #}
{% if entry is defined %}
{# Find the current entry in the other locale #}
{% set localeEntry = craft.entries.id(entry.id).locale(locale).first %}
@ockam
ockam / SassMeister-input.scss
Created August 4, 2015 11:59
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
@import "sass-maps-plus";
$viewport: (
width: (
small: 400,