View removeUnusedLayerStyles.js
function cleanLayerStyless(array) { | |
var layers = [] | |
array.forEach(function(layer) { | |
if (layer.class() == 'MSShapeGroup') layers.push(layer) | |
}) | |
for (var i = 0; i < layers.length; i++) { | |
layers.forEach(function(layer, index) { | |
var fills = layer.style().fills() | |
fills.forEach(function(fill, fillIndex) { |
View sketch-plugin-dialog-window.js
function createDialogWindow(context) { | |
// Setup the window | |
var alert = COSAlertWindow.new() | |
alert.setMessageText("Example modal") | |
alert.addButtonWithTitle("Run") | |
alert.addButtonWithTitle("Cancel") | |
// Create initial view panel | |
var width = 425 |
View sketch-plugin-file-tree
example.sketchPlugin | |
└── Contents | |
├── Resources | |
└── Sketch | |
├── manifest.json | |
└── yourFunction.js |
View city-lights-hyper-theme.js
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// Choose either "stable" for receiving highly polished, | |
// or "canary" for less polished but more frequent updates | |
updateChannel: 'stable', |
View recursive-layer-search-in-selection.js
var selection = context.selection | |
var shapeGroups = [] | |
function searchInLayer(layer) { | |
switch (layer.class())) { | |
case MSPage: | |
case MSLayerGroup: | |
case MSArtboardGroup: | |
let sublayers = layer.layers() | |
for (let i = 0; i < sublayers.count(); i++) { |
View seconds-to-hour-minute-seconds.js
secondsToHourMinuteSecond(totalSeconds) { | |
let hour = Math.floor(totalSeconds / 3600); | |
let minute = Math.floor(totalSeconds % 3600 / 60); | |
let seconds = Math.floor(totalSeconds % 3600 % 60); | |
return `${('0' + hour).slice(-2)}:${('0' + minute).slice(-2)}:${('0' + seconds).slice(-2)}` | |
} | |
/* | |
returns total seconds to hh:mm:ss value. |
View .editorconfig
root = true | |
[*.py] | |
indent_style = tab | |
indent_size = 4 | |
insert_final_newline = true | |
trim_trailing_whitespace = true | |
end_of_line = lf | |
charset = utf-8 |
View allow-svg-mime-types.php
<?php | |
# mime = meme | |
function cc_mime_types($memes) { | |
$memes['svg'] = 'image/svg+xml'; | |
return $memes; | |
} | |
add_filter('upload_mimes', 'cc_mime_types'); | |
function fix_svg() { |
View wp-docker-compose.yml
version: '2' | |
services: | |
wordpress: | |
depends_on: | |
- db | |
image: wordpress:4.7.1 | |
restart: always | |
volumes: | |
- ./wp-content:/var/www/html/wp-content | |
environment: |
View city-lights.terminal
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlackColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T | |
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECgwLjIwNzg0MzEz | |
NzMgMC4yNDcwNTg4MjM1IDAuMjg2Mjc0NTA5OCAxTxAnMC4xNTc1NDY3NDM4IDAuMTg4 |
OlderNewer