Skip to content

Instantly share code, notes, and snippets.

/*
* This script fetches all color styles from a Figma team/document.
*
* Dependencies:
*
* - node-fetch
*
* Due to a limitation in the Figma /styles endpoint, we need to use a
* document for actually using the colors in a color grid 🙄That's why
* we're both fetching from /styles and /files below.
@IamNaN
IamNaN / readme
Created November 27, 2012 23:12
Regex to parse HTML attribute/value pairs.
This regex parses attributes from their values such as those in HTML elements. It returns the attribute
names and their values even when the quotes are escaped, nested, or omitted.
The following are examples attribute/value pairs that are properly divided:
a="a" b="b b" c='c' d=1 e="escaped \" quotes" f="'nested quotes'" g = 'gaps' h="multiple spaces"
The attribute name will be in match position 0, while the value will be in either position 4 or 5
depending on whether or not the value is quoted.
@ruario
ruario / one-shot-sftp.md
Last active January 19, 2022 17:22
How to upload a file(s), to a remote location in one go with sftp. Useful for automation.

Normally if you want to quickly send a file to a remote directory on an ssh server as a one liner or within a script, the following would suffice:

scp file server:path

Occasionally, you may come across a server that only has sftp enabled and not scp. For example if the OpenSSH server you were connecting to was configured as follows:

Subsystem sftp internal-sftp
@mmazanec22
mmazanec22 / README.md
Last active April 26, 2019 08:44
Intercom Accessibility Hack

How to use angular.js with browserify.

To define a factory, service, controller or a directive, use the following format:

exports.inject = function(app) {
    app.factory('MyFactory', exports.factory);
    return exports.factory;
}
<!-- personportal: -->
<div style="margin: 0 7px 15px 7px; background-color: #FEEDC3; width: 715px; height:38px; border: 1px #CDD1D2 solid; padding: 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); border-radius: 3px;">
<span style="background: url(/sb-js/css/images/icons/stb-misc-icons-sprite.png); background-position: 0 -30px; height: 30px; width: 30px; display: inline-block; float: left; margin: 2px 10px 0 2px;"></span>
<p style="font-weight: 800; font-size: 12px; font-family: Helvetica Neue,Helvetica,Arial,sans-serif">
Information about employer paid pensions and insurance is available in English. Some information about private products and bank services are not translated into English yet. Questions? Please contact us at +47 08880.
</p>
</div>
<!-- pm-js: -->
<div class="stb-section-clear importantmessages" style="margin: 8px 0 8px 0; min-height: 60px; width: 75%; display: inline-block;"><span class="icon info" style="float:left; margin: 13px;"></span><section><p style="font-weight: 800;">