Skip to content

Instantly share code, notes, and snippets.

@ykarikos
ykarikos / png2svg.sh
Created June 7, 2012 22:17
Convert png to svg using imagemagick and potrace
#!/bin/bash
if [ "$1" == "" ]; then
echo Usage: $0 pngfile
exit 0;
fi
FILE=`basename $1 .png`
if [ ! -e $FILE.png ]; then
@zeffii
zeffii / _.md
Created February 4, 2013 22:42
Pattern grid - raster

[ Launch: Pattern grid - raster ] 4710427 by zeffii[ Launch: Pattern grid - raster ] 4659977 by roundrobin[ Launch: Pattern grid - 2 ] 4659021 by roundrobin[ Launch: Pattern grid - stripes ] 4657513 by roundrobin[ Launch: Pattern grid - wave ] 4647105 by roundrobin[ Launch: Pattern grid - elector ] 4647086 by roundrobin[ Launch: Pattern grid - elector ] 4647080 by roundrobin[ Launch: Pattern grid - 50-50 circles ] 4647076 by roundrobin[ Launch: Pattern grid - double quater circles ] 4647019 by roundrobin[ L

@codeguy
codeguy / slugify.js
Created September 24, 2013 13:19
Create slug from string in Javascript
function string_to_slug (str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}
@thomir
thomir / svg2png.py
Created December 21, 2013 22:21
Various ways to convert SVG -> PNG
#!/usr/bin/env python
"""Convert an SVG file to a PNG file."""
from argparse import ArgumentParser
import subprocess
import os.path
def main():
@lilydjwg
lilydjwg / ttc2ttf
Last active July 12, 2023 14:27
Convert .ttc to several .ttf files into the current directory
#!/usr/bin/env python3
import sys
import fontforge
def main(file):
for font in fontforge.fontsInFile(file):
f = fontforge.open(u'%s(%s)' % (file, font))
f.generate('%s.ttf' % font)
@mhartington
mhartington / CustomTheme
Last active December 8, 2018 20:35
If you want to make a custom theme for ionic, and are using scss, this is a base to get you started
//Custom Theme test
// Colors
// -------------------------------
$custom: #057b6c !default;
// Buttons
// -------------------------------
$button-custom-bg: $custom !default;
@staltz
staltz / introrx.md
Last active November 14, 2024 11:27
The introduction to Reactive Programming you've been missing
@hawkz
hawkz / SVG Stroke Text Effect.markdown
Created September 5, 2015 17:30
SVG Stroke Text Effect
@alexjlockwood
alexjlockwood / flatten.js
Created December 11, 2016 22:00 — forked from timo22345/flatten.js
Flatten.js, general SVG flattener. Flattens transformations of SVG shapes and paths. All shapes and path commands are supported.
<!doctype html>
<html>
<title>Flatten.js, General SVG Flattener</title>
<head>
<script>
/*
Random path and shape generator, flattener test base: http://jsfiddle.net/xqq5w/embedded/result/
Basic usage example: http://jsfiddle.net/Nv78L/3/embedded/result/
'use strict';
const X = [0.1, 0.5, 0.9, 1.3, 1.7];
const Y = [-2.3026, -0.69315, -0.10536, 0.26236, 0.53063];
const x = 0.8;
// const n = 3;
// var splines = new Array(X.length).fill({a:null,b:null,c:null,d:null,x:null});
var splines = [];
for (let i =0; i < X.length; i++){
splines.push({a:null,b:null,c:null,d:null,x:null});