Skip to content

Instantly share code, notes, and snippets.

@dukemai
dukemai / import-amundi.js
Created September 29, 2020 21:52
import
const pLimit = require("p-limit");
const axios = require("axios");
const XLSX = require("xlsx");
const db = require("./data/db");
const { listRows } = require("./lib/google-drive");
const transform = require("./data/transformers/raw-amundi");
const { logger } = require("../logger");
const amundiId = "1MG_NAeEgtcwxYeioEBckygAa5nlcWPPnLsohgc2nBbE";
@willowCeleste
willowCeleste / imageHero.js
Created February 8, 2022 18:42
Hero custom cursor logic at the module level
import Swiper, { Navigation, EffectFade } from 'swiper';
Swiper.use([Navigation, EffectFade]);
const component = document.querySelector('[data-component="imageHero"]');
export default {
init
};
function init () {
return bindEvents();
@willowCeleste
willowCeleste / data-import.js
Created February 8, 2022 19:19
CSV import
const rollbar = require('../helpers/rollbar');
const _ = require('lodash');
module.exports = {
name: 'data-import',
label: 'Data Import',
pluralLabel: 'Data Imports',
seo: false,
openGraph: false,
addFields: [
@SS-brainstorm
SS-brainstorm / .eslintrc.js
Created January 19, 2020 12:19
eslint default config
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:promise/recommended",
"plugin:sonarjs/recommended",
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 10:31
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@ccwasden
ccwasden / automateSandboxTesterEntry.js
Last active May 6, 2024 10:31
Automate rapid/fast creation of sandbox testers in itunesConnect
// Steps to use:
// 1. Go to itunesConnect > Users & Roles
// 2. Select "Testers" under the "Sandbox" header on the left
// 2. Open the console on your browser (eg. CMD-OPT-J)
// 3. Paste the code below (modified to your liking) into the console and hit enter
// 4. enter `createUser('desiredEmailAlias')` into the console and watch the user get created automatically
//
// NOTE: To create several users rapidly: in the console hit the up arrow, change the alias, and hit enter again. Repeat.
// Edit the user here to your liking
@ccwasden
ccwasden / Await+Threading.swift
Created April 27, 2020 22:39
Await+Threading
//
// Author: Chase Wasden
// Website: https://gist.github.com/ccwasden
// Licensed under MIT license https://opensource.org/licenses/MIT
//
import Foundation
import Combine
// Threading
@Rich-Harris
Rich-Harris / script.sh
Created September 16, 2018 02:23
10 second Svelte demo
echo "<button on:click='set({ count: count + 1 })'>{count}</button>" > App.html
npx svelte compile App.html --format iife --name App > App.js
echo "<div id=target></div>
<script src=App.js></script>
<script>
new App({
target,
data: { count: 0 }
@Rich-Harris
Rich-Harris / wishlist.md
Created November 9, 2018 13:40
Platform wishlist

Platform wishlist

An unconnected list of things it'd be nice to have in the platform. I may add to this over time

SVG 2

Is this ever going to happen? SVG 1.1 is really showing its age, and it feels like something browser vendors have long since stopped caring about

Cmd-F

@Rich-Harris
Rich-Harris / extensions.md
Last active May 6, 2024 10:29
What should be the canonical file extension for Svelte components?

So far, most of us have been writing Svelte components into .html files, with a few exceptions (Parcel users, for example, have additional constraints to work with). We're currently discussing whether this should change.

Once you've read the pros and cons, please vote!

.html

Pros:

  • It signals that you can use your existing HTML (and CSS) knowledge
  • Valid HTML is valid Svelte