Skip to content

Instantly share code, notes, and snippets.

@gtalarico
gtalarico / airtable.js
Last active February 11, 2021 13:15
Airtable Netlify Lambda Function Setup
// lambda/airtable.js
const Airtable = require('airtable')
Airtable.configure({
endpointUrl: 'https://api.airtable.com',
apiKey: process.env.AIRTABLE_KEY
})
const base = Airtable.base('appNtnZ99fkL1cByn')
exports.handler = function(event, context, callback) {
@j0hnm4r5
j0hnm4r5 / package.json
Created March 7, 2019 02:55
Netlify Free Password Protection
{
...,
"scripts": {
"start": "gatsby develop -p 1234 -H 0.0.0.0",
"publish": "npm run _clean && npm run _build && npm run _encrypt && npm run _envDeploy",
"//": "========= PRIVATE SCRIPTS =========",
"_clean": "gatsby clean",
"_build": "gatsby build",
"_encrypt": "npx staticrypt public/index.html P@55W0RD -o public/index.html",
"_deploy": "npx netlify-cli deploy --dir=public --prod",
@sonburn
sonburn / getSetValueOnLayer.js
Last active January 8, 2021 03:16
Get or set a value on a layer in Sketch
var value = nil,
key = "kModelPropertiesKey",
layer = context.selection[0],
plugin = "com.animaapp.stc-sketch-plugin";
// Get the value
context.command.valueForKey_onLayer_forPluginIdentifier(key,layer,plugin);
// Set the value
context.command.setValue_forKey_onLayer_forPluginIdentifier(value,key,layer,plugin);
@chadlavi
chadlavi / upload-sketch-to-git.sh
Last active September 10, 2021 10:51
shell script to work as middleware between Sketch and and git repo. syntax: 'upload.sh [filename] "optional commit message"'
#!/bin/sh
# some parts of this forked from https://github.com/blended/sketch-collaboration
# cf. https://github.com/chadlavi/sketch-collaboration
if [ ! `command -v jq` ]; then
echo "you need to install jq. If you use Homebrew, try 'brew install jq'"
exit 1
fi
if [ -z "$1 ]; then
@ekryski
ekryski / circle.yml
Last active October 28, 2022 14:46
Using Yarn with CircleCI and Heroku
machine:
pre:
- mkdir ~/.yarn-cache
node:
version: stable
dependencies:
pre:
- curl -o- -L https://yarnpkg.com/install.sh | bash
cache_directories:
- ~/.yarn-cache
@chriskjaer
chriskjaer / circle.yml
Last active March 22, 2017 22:29
Use Yarn on CircleCI with cache
machine:
pre:
- mkdir ~/.yarn-cache
dependencies:
pre:
- curl -o- -L https://yarnpkg.com/install.sh | bash
cache_directories:
- ~/.yarn-cache
override:
@vidaaudrey
vidaaudrey / ie67891011-css-hacks.txt
Created June 19, 2016 20:52 — forked from ricardozea/ie67891011-css-hacks.txt
IE CSS hacks - IE6, 7, 8, 9, 10, 11
IE6 Only
==================
_selector {...}
IE6 & IE7
==================
*html or { _property: }
IE7 Only
==================
@ducin
ducin / README.md
Last active April 15, 2018 15:33
JSON-Schema-faker console basic demo

JSON-Schema-faker demo

Run the following:

npm install
node run.js

to execute the demo.

@xfanwu
xfanwu / xxf.zsh-theme
Last active June 14, 2024 21:45
Yet another theme for oh-my-zsh
# Copy and self modified from ys.zsh-theme, the one of default themes in master repository
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background and the font Inconsolata.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
# http://xiaofan.at
# 2 Jul 2015 - Xiaofan
# Machine name.
function box_name {
// based on http://onais-m.blogspot.nl/2014/10/automatic-graph-layout-with-javascript.html
var jsp = jsPlumb.getInstance();
// construct dagre graph from JsPlumb graph
/* global dagre */
var g = new dagre.graphlib.Graph();
g.setGraph({});
g.setDefaultEdgeLabel(function() { return {}; });
$('.xnode').each(