Skip to content

Instantly share code, notes, and snippets.

View peterpme's full-sized avatar
🏠
Working from home

Peter Piekarczyk peterpme

🏠
Working from home
View GitHub Profile
var __slice = Array.prototype.slice;
function variadic (fn) {
var fnLength = fn.length;
if (fnLength < 1) {
return fn;
}
else if (fnLength === 1) {
return function () {
@peterpme
peterpme / .slaterc
Created May 20, 2014 20:24
Slaterc dotfile
# Config
config windowHintsFontSize 100
config nudgePercentOf screenSize
config resizePercentOf screenSize
config windowHintsTopLeftX (windowSizeX/2)-(windowHintsWidth/2)
config windowHintsTopLeftY (windowSizeY/2)-(windowHintsHeight/2)
config windowHintsIgnoreHiddenWindows false
# General aliases
alias sox screenOriginX
@peterpme
peterpme / SassMeister-input.scss
Created May 22, 2014 17:45
Generated by SassMeister.com.
// ----
// Sass (v3.3.7)
// Compass (v1.0.0.alpha.18)
// ----
$main-font:2em;
$sub-font:1.5em;
$mini-font:1.3em;
@each $header, $size in (h1:$main-font,h2:$sub-font,h3:$mini-font,h4:1.2em){
@peterpme
peterpme / angular.js
Created July 27, 2014 20:59
Angular Namespacing
// init
var basketApplication = {};
basketApplication.ng = angular.module('basketApplication-website', [
'angular-logger'
]);
// some directive
@peterpme
peterpme / .slate
Created October 30, 2014 14:27
slate config
# Config
config windowHintsFontSize 100
config nudgePercentOf screenSize
config resizePercentOf screenSize
config windowHintsTopLeftX (windowSizeX/2)-(windowHintsWidth/2)
config windowHintsTopLeftY (windowSizeY/2)-(windowHintsHeight/2)
config windowHintsIgnoreHiddenWindows false
# General aliases
alias sox screenOriginX
@peterpme
peterpme / slate
Created November 11, 2014 17:50
slaterc
config nudgePercentOf screenSize
config resizePercentOf screenSize
config windowHintsTopLeftX (windowSizeX/2)-(windowHintsWidth/2)
config windowHintsTopLeftY (windowSizeY/2)-(windowHintsHeight/2)
#set ignore hidden windows to false
config windowHintsIgnoreHiddenWindows false
# monitors will be ordered from left to right by X coordinate. When false it follows OSX internal ordering
config orderScreensLeftToRight true
config keyboardLayout "qwerty"
# focus all windows touched by the activated layout
@peterpme
peterpme / .slate
Created November 13, 2014 16:34
slaterc
config nudgePercentOf screenSize
config resizePercentOf screenSize
config windowHintsTopLeftX (windowSizeX/2)-(windowHintsWidth/2)
config windowHintsTopLeftY (windowSizeY/2)-(windowHintsHeight/2)
#set ignore hidden windows to false
config windowHintsIgnoreHiddenWindows false
# monitors will be ordered from left to right by X coordinate. When false it follows OSX internal ordering
config orderScreensLeftToRight true
config keyboardLayout "qwerty"
# focus all windows touched by the activated layout
@peterpme
peterpme / validation.js
Created May 1, 2015 21:11
validtion.js
var ccAppForm = document.getElementsByClassName('cc-app'),
infoAccept = document.getElementsByClassName('info-accept'),
infoDeny = document.getElementsByClassName('info-deny'),
infoError = document.getElementsByClassName('info-error'),
errorAlert = document.getElementsByClassName('error-alert'),
infoLoading = document.getElementsByClassName('info-loading'),
radios = document.getElementsByClassName('input-radio'),
inputs = document.getElementsByClassName('input-text'),
submitButton = document.querySelector('button');
@peterpme
peterpme / SassMeister-input.scss
Created May 12, 2015 21:48
Generated by SassMeister.com.
// ----
// libsass (v3.2.2)
// ----
%InlineButton2 {
background:white;
color:black;
border:1px solid transparent;
white-space:nowrap;
padding:5px 10px;
@peterpme
peterpme / Parent.es6
Last active August 29, 2015 14:25
Is it possible to access the handleClick method and/or state from inside the Section component rather than declaring those methods inside ParentComponent? I would like Section to manage its own state and handlers
const ParentComponent = React.createClass({
render() {
<Section>
<button type="button" onClick={this.handleClick}>{!this.state.isEditing ? 'Edit' : 'Cancel'}</button>
</Section>
}
})
// here this.handleClick() should come from Section
// this.state.isEditing same idea