Skip to content

Instantly share code, notes, and snippets.

@macouella
macouella / set_colours.fish
Last active October 13, 2020 08:24
Atom One dark pro + Fish + iTerm2
# Colours taken from https://github.com/Binaryify/OneDark-Pro
# base: #282c34
# mono-1: #abb2bf
# mono-2: #818896
# mono-3: #5c6370
# hue-1: #56b6c2
# hue-2: #61aeee
# hue-3: #c678dd
# hue-4: #98c379
@macouella
macouella / lvh_ssl.md
Last active September 25, 2019 22:00 — forked from dagjaneiro/lvh_ssl.md
lvh.me ssl

Install nginx

$ brew install nginx

Edit nginx.conf

$ vim /usr/local/etc/nginx/nginx.conf
@macouella
macouella / extract-colours-from-site.js
Last active November 12, 2020 03:34
Extract all colours from a site :)
function rgb2hex(rgb) {
if (rgb.search("rgb") == -1) {
return rgb;
} else {
rgb = rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/);
function hex(x) {
return ("0" + parseInt(x).toString(16)).slice(-2);
}
return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
}
@macouella
macouella / shortcuts.md
Last active July 29, 2019 02:05
VSCode Shortcuts

Hello!

Useful plugins

Expand selection to scope

Disable fn keys

System Preferences > Keyboard > Tick Use f1, f2, etc. as standard function keys...

@macouella
macouella / SimonApp.js
Created October 9, 2018 07:06
For Simon
import React from "react";
import { StyleSheet, View, Button, TextInput } from "react-native";
import { Formik, Field } from "formik";
const MyTextInput = ({ field, ...props }) => {
console.log(field, props);
return (
<TextInput
value={field.value}
onChangeText={props.form.handleChange(field.name)}
onBlur={props.form.handleBlur(field.name)}
@macouella
macouella / Magento.postman_collection.json
Created September 6, 2018 02:25
Magento Postman Collection
{
"info": {
"_postman_id": "ac491bb7-de4a-4258-b717-ba80070f50fe",
"name": "Magento",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Mine / Me",
"item": [
@macouella
macouella / docker-magento2-setup.md
Last active June 28, 2018 02:48
Setting up a Magento2 docker development environment

Prereqs

  • Obtain public/private pair after generating one from https://marketplace.magento.com/customer/accessKeys/
  • Use the public key as username and the private key as password.
  • Docker, composer installed
  • Configure docker file-sharing to include the folder you'll chuck the magento install in

Setting up the dev environment

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition dockgento
# Enter username and public auth key from above
@macouella
macouella / disable-unused-magento-modules.md
Last active July 2, 2018 10:00 — forked from tomysmile/mac-php-composer-setup.md
Setting up a fast Magento development server for OSX

Disabling unused magento modules to speed up development

Optional - I have done some testing and the following modules are easily disabled. Run at your own discretion!

bin/magento module:disable --clear-static-content Magento_ConfigurableSampleData Magento_SampleData Magento_MsrpSampleData Magento_DownloadableSampleData Magento_BundleSampleData Magento_CustomerSampleData Magento_ThemeSampleData Magento_SwatchesSampleData Magento_TaxSampleData Magento_CmsSampleData Magento_WidgetSampleData Magento_WishlistSampleData Magento_ReviewSampleData Magento_OfflineShippingSampleData Magento_SalesRuleSampleData Magento_SalesSampleData Magento_ProductLinksSampleData Magento_GroupedProductSampleData Magento_CatalogSampleData Magento_CatalogRuleSampleData Magento_GoogleOptimizer Magento_GoogleAdwords Magento_GoogleAnalytics Magento_Analytics Magento_QuoteAnalytics Magento_CustomerAnalytics Magento_WishlistAnalytics Magento_ReviewAnalytics Magento_SalesAnalytics Amazon_Core Klarna_Core Amazon_Login Amazon_Payment Kla
@macouella
macouella / gist:b913607cca3d9bfa2640ce26e1db7373
Created May 29, 2018 12:05
Somethings gotta give webpack
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const BrowserSyncPlugin = require("browser-sync-webpack-plugin");
const devMode = process.env.NODE_ENV !== "production";
const path = require("path");
const path = require('path');
const pathConfig = require('./path-config.json');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin;
const opn = require('opn');
module.exports = {
html: false,
ghPages: false,
images: true,