Skip to content

Instantly share code, notes, and snippets.

View adamalfredsson's full-sized avatar

Adam Alfredsson adamalfredsson

View GitHub Profile
// https://github.com/tailwindlabs/tailwindcss/issues/1595#issuecomment-617131891
const resolveConfig = require("tailwindcss/resolveConfig");
function mapObject(fn, obj) {
if (typeof Object.fromEntries === "function")
return Object.fromEntries(Object.entries(obj).map(fn));
return Object.entries(obj).reduce((acc, [key, val], idx, entries) => {
const [newKey, newVal] = fn([key, val], idx, entries);
return { ...acc, [newKey]: newVal };
@adamalfredsson
adamalfredsson / History|-10502093|entries.json
Last active November 13, 2022 11:21
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/Adam/Projects/levelnine/netclean-web/components/blocks/article-video-block.stories.jsx","entries":[{"id":"5pio.jsx","source":"Workspace Edit","timestamp":1657113013689},{"id":"BFOy.jsx","source":"searchReplace.source","timestamp":1657113051771},{"id":"tZMW.jsx","source":"Workspace Edit","timestamp":1657113419792},{"id":"y04N.jsx","source":"Workspace Edit","timestamp":1657113461204}]}
@adamalfredsson
adamalfredsson / inspirobot.gs
Last active March 11, 2020 13:36
Daily inspiration to slack. Active spreadsheet should contain a sheet "Messages" with one column for each weekday and a header row.
var TEST_WEBHOOK = PropertiesService.getScriptProperties().getProperty('SLACK_TEST_WEBHOOK');
var PROD_WEBHOOK = PropertiesService.getScriptProperties().getProperty('SLACK_PROD_WEBHOOK');
function setInspirationTrigger() {
ScriptApp.newTrigger('sendInspirationOnWeekday')
.timeBased()
.everyDays(1)
.atHour(09)
.nearMinute(00)
.create()
@adamalfredsson
adamalfredsson / keybindings.json
Last active February 11, 2019 11:09
VSCode Keybindings
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "shift+cmd+t",
"command": "workbench.action.terminal.new",
"when": "terminalFocus"
},
{
"key": "cmd+w",
"command": "workbench.action.terminal.kill",
@adamalfredsson
adamalfredsson / launch.json
Last active February 8, 2019 14:48
Mocha test
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha All",
"program": "${workspaceFolder}/packages/server/node_modules/mocha/bin/_mocha",
"args": ["-r", "ts-node/register", "--timeout", "999999", "--colors", "${workspaceFolder}/packages/server/src/modules/**/*.test.ts"],
"cwd": "${workspaceFolder}/packages/server",
@adamalfredsson
adamalfredsson / settings.json
Last active February 11, 2019 11:09
VSCode Settings
{
"editor.formatOnSave": true,
"git.enabled": false,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/node_modules": false