Skip to content

Instantly share code, notes, and snippets.


Pete petekp

View GitHub Profile
petekp / textToJson.js
Last active Aug 29, 2020
Convert delimited .txt to .json
View textToJson.js
var fs = require('fs')
const jsonifyText = text => {
const cleaned = text
.map(item => item.split(/:(.+)/).filter(Boolean))
const structured = {
petekp / Button.tsx
Created Jul 19, 2019
Substrate Themed Button Example
View Button.tsx
import * as React from 'react'
import {
} from 'react-native'
import { ThemedComponentLocked } from '../../typings'
petekp / tsconfig.json
Created Mar 14, 2019
tsconfig.json for npm react component lib
View tsconfig.json
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"baseUrl": "src",
"declaration": true,
"jsx": "react",
"module": "commonjs",
"moduleResolution": "node",
"noUnusedLocals": true,
petekp / build.ts
Last active Jan 9, 2019
Node build script for creating distributable multi-format themes with Theo
View build.ts
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'
View theme.d.ts
export declare const Theme: {
zIndex: {
alert: number
dialog: number
mesosphere: number
modal: number
navigationBar: number
popover: number
root: number
stratosphere: number
petekp / cloudSettings
Last active Oct 15, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
# 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 ->
petekp / taggify.js
Last active Oct 18, 2015
Wrap all characters in a string with any XHTML tag (ES6, lodash)
View taggify.js
taggify(string, tag) {
let taggedChars = [], function(char) {
return taggedChars.join('')
petekp / index.html
Created Oct 13, 2012
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.
View index.html
<a href="#" class="thumbnail green"><div class="photo"><img src=""></div><span class="title">Thumb Title</span></a>
<a href="#" class="thumbnail blue"><div class="photo"><img src=""></div><span class="title">Thumb Title</span></a>
<a href="#" class="thumbnail red"><div class="photo"><img src=""></div><span class="title">Thumb Title</span></a>
<a href="#" class="thumbnail purple"><div class="photo"><img src=""></div><span class="title">Thumb Title</span></a>
You can’t perform that action at this time.