Skip to content

Instantly share code, notes, and snippets.

@Pastez
Pastez / replaceAndSave
Last active February 13, 2024 05:11
Adobe Illustrator script that replace text with text from array. Script then creates outlines of that text and save it as pdf file in provided directory. Greate for wedding invitation :).
/*
do What The Fuck you want to Public License
Version 1.0, August 2015
Copyright (C) 2015 Tomasz Kwolek.
www.pastez.com
www.cheerapp.pl
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@Pastez
Pastez / pasTxtToSrt_v2.py
Created December 14, 2014 19:49
Converts TXT (MicroDVD, MPL2) subtitles to SRT (SubRip) format. Movie FPS is detected using mplayer
#!/usr/bin/python
import sys, subprocess, getopt, math
import re, os
FORMAT_MICRO_DVD = "}"
FORMAT_MPL2 = "]"
MPLAYER_PATH = "/Applications/MPlayerX.app/Contents/Resources/MPlayerX.mplayer.bundle/Contents/Resources/x86_64/mplayer"
MOVIE_FORMATS = ['avi', 'mp4']
@Pastez
Pastez / battleships.playground
Created November 17, 2014 13:11
Battleships - bad assumptions :)
import UIKit
//typealias GridSize = (w:Int, h:Int)
struct GridSize {
let w:Int
let h:Int
init(_ width:Int,_ height:Int)
{
@Pastez
Pastez / pasTxtToSrt.py
Created November 11, 2014 18:48
Converts TXT (MicroDVD, MPL2) subtitles to SRT (SubRip) format
#!/usr/bin/python
import sys, getopt, math
FORMAT_MICRO_DVD = "}"
FORMAT_MPL2 = "]"
def addZero(ts):
if len(ts) < 2:
ts = '0' + ts
@Pastez
Pastez / 2048Game
Last active August 29, 2015 14:05
// Playground - noun: a place where people can play
import Cocoa
import SpriteKit
import XCPlayground
/** Possible values for new cells **/
let kPossibleRandomValues = [2,4]
struct Position