Skip to content

Instantly share code, notes, and snippets.

@icebeat
icebeat / settings.json
Created March 15, 2023 14:03
VSCODE extensions
{
"indentRainbow.indicatorStyle": "light",
"indentRainbow.lightIndicatorStyleLineWidth": 1,
"indentRainbow.colors": [
"rgba(255,255,64,0.15)",
"rgba(127,255,127,0.15)",
"rgba(255,127,255,0.15)",
"rgba(79,236,236,0.15)"
],
"todo-tree.highlights.enabled": true,
@icebeat
icebeat / figma_hooks_slack.js
Created September 24, 2021 14:04
JS function for sending Slack messages from Figma Hooks API
const https = require('https');
const SLACK_TOKEN = '';
const PASSCODE = '';
const CHANNEL_REGEX = /\s(\#.*)$/;
const JIRA_REGEX = /^(JIRA-[^\s]+)\s/;
const DEFAULT_CHANNEL = '';
const TEAM_ID = '';
// FILE NAME: JIRA-1234 UI KIT #channel
@icebeat
icebeat / createNode
Created March 20, 2017 08:51
Create dom nodes from html string
const createNode = html => new DOMParser().parseFromString(html, "text/html").body.firstChild
const example = createNode(`
<section>
<h1>Hello World</h1>
</section>
`)
@icebeat
icebeat / .stylelintrc.json
Created February 4, 2016 10:31
Stylelint rules (scss syntax)
{
"ignoreFiles": ["app/styles/vendor/**"],
"rules": {
"at-rule-empty-line-before": ["always", {
"except": ["blockless-group", "first-nested"],
"ignore": ["after-comment"]
}],
"block-closing-brace-newline-after": "always",
"block-closing-brace-newline-before": "always-multi-line",
"block-closing-brace-space-before": "always-single-line",
@icebeat
icebeat / tripadvisor.js
Created January 11, 2016 09:59
Tripadvisor parser with x-ray
"use strict";
const Xray = require('x-ray');
const x = Xray();
const fs = require('fs');
const tripavisorUrl = 'http://www.tripadvisor.com/Restaurant_Review-g187514-d4760195-Reviews-La_Huerta_de_Tudela-Madrid.html';
x(tripavisorUrl, {
id: '.mapContainer@data-locid',
@icebeat
icebeat / widow.rb
Created June 11, 2015 08:27
Jekyll plugin - No more widows in your headlines
module Jekyll
module Widow
def widow(text)
text.gsub!(/ ([^ ]*)$/, '&nbsp;\1')
end
end
end
@icebeat
icebeat / SassMeister-input.scss
Created December 5, 2014 12:10
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
.badge {
$c: &;
&--primary {
var gulp = require('gulp');
var Metalsmith = require('metalsmith');
/* Gulp libs */
var sketch = require("gulp-sketch");
var clean = require('gulp-clean');
var svgmin = require('gulp-svgmin');
/* Custom libs */
var src = require('./lib/src');
@icebeat
icebeat / nikeplus.py
Created November 4, 2013 13:56
Export your Nike plus activities and save the world.
import json, requests
# 0. https://gist.github.com/leah/5655437 (The base)
# 1. easy_install requests (install dependency)
# 2. python nikeplus.py
# 3. Enjoy!
TOKEN = "YOUR TOKEN" # http://developer.nike.com
PATH2SAVE = "/"
@icebeat
icebeat / class_completions.py
Last active December 18, 2015 15:29
Sublime Text 2 - CSS Class completions with the active CSS files / ctrl+space to trigger the autocomplete. http://cl.ly/PiLT
import sublime, sublime_plugin, re, os.path
class ClassCompletions(sublime_plugin.EventListener):
def get_completions(self):
completions = []
# loop views
for v in sublime.active_window().views():
# only css/scss files
if v.match_selector(0, "source.css, source.scss"):