Skip to content

Instantly share code, notes, and snippets.

View petekp's full-sized avatar

Pete Petrash petekp

View GitHub Profile
@petekp
petekp / index.html
Created October 13, 2012 06:53
For my portfolio I wanted a grid of thumbnails that scaleZ on hover, overlapping their siblings. Added some blur and some scaling effect to the thumb title to create a neat depth effect. Still tweaking for mobile and non-Chrome browsers.
<a href="#" class="thumbnail green"><div class="photo"><img src="http://www.photographyblogger.net/wp-content/uploads/2011/02/0410.jpg"></div><span class="title">Thumb Title</span></a>
<a href="#" class="thumbnail blue"><div class="photo"><img src="http://25.media.tumblr.com/tumblr_m4zl640xqN1rxrpico2_1280.jpg"></div><span class="title">Thumb Title</span></a>
<a href="#" class="thumbnail red"><div class="photo"><img src="http://3.bp.blogspot.com/-fZzVHhusP04/Ta-RoCMJW2I/AAAAAAAABxc/ehuIytZernY/s1600/FROGpoison-dart-frog_5869_600x450.jpg"></div><span class="title">Thumb Title</span></a>
<a href="#" class="thumbnail purple"><div class="photo"><img src="http://1.bp.blogspot.com/-_DbIIL07P6c/Ta-TQOMl0qI/AAAAAAAABxo/jSW1GbNfrj0/s1600/frog-picture.jpg"></div><span class="title">Thumb Title</span></a>
@petekp
petekp / taggify.js
Last active October 18, 2015 21:18
Wrap all characters in a string with any XHTML tag (ES6, lodash)
taggify(string, tag) {
let taggedChars = []
_.map(string, function(char) {
taggedChars.push(`<${tag}>${char}</${tag}>`)
})
return taggedChars.join('')
}
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
export declare const Theme: {
zIndex: {
alert: number
dialog: number
mesosphere: number
modal: number
navigationBar: number
popover: number
root: number
stratosphere: number
@petekp
petekp / build.ts
Last active January 9, 2019 04:11
Node build script for creating distributable multi-format themes with Theo
import chalk from 'chalk'
import * as path from 'path'
import * as rimraf from 'rimraf'
import { promisify } from 'util'
import { flattenDeep } from 'lodash'
import { exec } from 'child_process'
import { upperFirst, camelCase } from 'lodash'
import { promises as fsPromise, lstatSync, readdirSync } from 'fs'
import { Format, Transform, TheoConfig } from '../typings/theo'
@petekp
petekp / tsconfig.json
Created March 14, 2019 19:35
tsconfig.json for npm react component lib
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"baseUrl": "src",
"declaration": true,
"jsx": "react",
"module": "commonjs",
"moduleResolution": "node",
"noUnusedLocals": true,
@petekp
petekp / Button.tsx
Created July 19, 2019 03:31
Substrate Themed Button Example
import * as React from 'react'
import {
TouchableOpacity,
StyleProp,
TouchableOpacityProps,
TextStyle,
Text,
} from 'react-native'
import { ThemedComponentLocked } from '../../typings'
@petekp
petekp / cloudSettings
Last active October 15, 2019 22:18
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-10-15T22:18:01.816Z","extensionVersion":"v3.4.3"}
@petekp
petekp / textToJson.js
Last active August 29, 2020 01:48
Convert delimited .txt to .json
var fs = require('fs')
const jsonifyText = text => {
const cleaned = text
.toString()
.split("\n")
.filter(Boolean)
.map(item => item.split(/:(.+)/).filter(Boolean))
const structured = {