Skip to content

Instantly share code, notes, and snippets.

View liitfr's full-sized avatar

Mathias Hoffmann liitfr

View GitHub Profile
@liitfr
liitfr / app.js
Last active March 18, 2019 13:03
[multiple entries with spike] #spike
const htmlStandards = require('reshape-standard')
const cssStandards = require('spike-css-standards')
const jsStandards = require('spike-js-standards')
const pageId = require('spike-page-id')
const { _ } = require('lodash')
const env = process.env.NODE_ENV
const entries = Object.assign({}, ..._.map(_.filter(fs.readdirSync('./assets/js/'), file => file.charAt(0) !== '_'), file =>
_.fromPairs([[`js/${path.parse(file).name}`, `./assets/js/${file}`]])))
@liitfr
liitfr / readme.md
Last active September 12, 2017 23:13
website : check list

Don't forget to ...

  1. Support for no-js (and other modernizr properties)
  2. Check good usage of semantic tags
  3. Generate favicons with http://realfavicongenerator.net/
  4. Google Analytics scripts
  5. Remove unused fonts
  6. Test on MS / chrome / iOs / FF browsers : mobile mode & desktop mode
  7. Run Lighthouse & iterate
  8. Run Pagespeed Insight
@liitfr
liitfr / .htaccess
Last active October 28, 2017 02:19
Service worker & offline first
# ...
<Files sw.js>
# FileETag None # LIIT : disabled this to check if it allows cdn update
# Header unset ETag # LIIT : disabled this to check if it allows cdn update
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</Files>
@liitfr
liitfr / readme.md
Created July 14, 2017 19:20
you accidentally commited your .env file in a previous commit, and you want it to disappear ? 🕵

Answer

Execute this code in your repository

git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch .env' \
--prune-empty --tag-name-filter cat -- --all
@liitfr
liitfr / after.png
Last active July 17, 2017 19:11
Google Font : Increase your Google's Page Speed Insight score
after.png
@liitfr
liitfr / app.js
Last active August 2, 2017 01:07
inline sugarss in sugarml with spike
const cssStandards = require('spike-css-standards')();
const postcss = require('postcss');
module.exports = {
reshape: htmlStandards({
locals: ctx => ({ pageId: pageId(ctx) }),
content: {
postcss: css => postcss(cssStandards.plugins)
.process(css, { parser: cssStandards.parser })
.then(res => res),
@liitfr
liitfr / readme.md
Last active September 22, 2023 19:18
unlock NP when stuck at "Pushing tags" step

If you want to push tag manually & identify problem

git push --follow-tags

Enable SSH

  1. Generate an SSH key

Open terminal to create ssh keys:

@liitfr
liitfr / readme.md
Last active September 12, 2017 14:50
How to use Zepto with Shoelace.css & Webpack

How to use Zepto with Shoelace.css & Webpack

first of, npm install --save-dev zepto-webpack.
Then, in your Webpack config :

  // ...
  resolve: {
    alias: {
      ShoelaceDropDowns: path.resolve(__dirname, 'node_modules/shoelace-css/source/js/dropdowns.js'),
      ShoelaceTabs: path.resolve(__dirname, 'node_modules/shoelace-css/source/js/tabs.js'),
@liitfr
liitfr / lambert-converter.js
Created November 17, 2017 16:41
Convert LAMBERT93 coordinates to WGS with JS
// this function converts LAMBERT93 coordinates used by IGN to lat / lon coordinates
// found here https://gist.github.com/will83/5920606
const toWGS = (x, y) => {
const b7 = 298.257222101;
const b8 = 1 / b7;
const b9 = 2 * b8 - b8 * b8;
const b10 = Math.sqrt(b9);
const b13 = 3;
const b14 = 700000;
const b15 = 12655612.0499;
@liitfr
liitfr / .gitignore
Last active November 28, 2017 12:09
quickly setup a mocking API server with JWT support
node_modules