Skip to content

Instantly share code, notes, and snippets.

@phaistonian
phaistonian / gpr.sh
Created Jan 26, 2021
alias gpr="sh gpr.sh"
View gpr.sh
#! /bin/bash
set -e
BRANCH=$(git rev-parse --abbrev-ref HEAD)
REMOTE=$(git remote get-url origin)
URL="$REMOTE/compare/$BRANCH?expand=1";
if [ "$BRANCH" = "master" ]
then
echo You must checkout a feature branch first
View getImgSrc.js
export default (input, options = {
title: 'image',
size: null,
height: null,
width: null,
crop: {},
cover: false,
}) => {
const data = typeof input === 'string'
? {
@phaistonian
phaistonian / saveToGSheet.js
Created Jul 12, 2017
A little helper to make saving to Google Sheets super easy
View saveToGSheet.js
// Instructions here: https://gist.github.com/phaistonian/1f3de5f8bc0acaf4c48334d0a9384d28
const saveToGSheet = (urlOrId, data) => {
const url = urlOrId.indexOf('https') === -1
? `https://script.google.com/macros/s/${urlOrId}/exec`
: urlOrId;
const formData = new FormData();
Object.keys(data)
.forEach(key => {
View gist:1f3de5f8bc0acaf4c48334d0a9384d28
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
View Icon.php
<?php
echo Utils::icon('hello-12');
?>
View Icon.jsx
import Icon from 'components/Icon';
export default ({ onClick }) => <Icon
icon="hello-12"
onClick={onClick} />;
@phaistonian
phaistonian / ResetPass.jsx
Last active Apr 13, 2017
The reset password template file for BPMail
View ResetPass.jsx
const App = props => {
const { authKey, recipientId } = props;
return (
<Body>
<Header />
<MainMessage img="reset_pass">
<P>Λάβαμε αίτημα για αλλαγή κωδικού πρόσβασης του λογαριασμού σου στο BestPrice.
Για να αλλάξεις τον κωδικό σου κάνε κλικ στο παρακάτω κουμπί:</P>
@phaistonian
phaistonian / adman-glomex-breakdown.js
Last active Jul 21, 2016
Glomex / Ant1 / Breakdown
View adman-glomex-breakdown.js
var adSchedule = {
start: 3251,
'20s': 3252,
'30s': 3253,
end: 3254
};
var parseAdSchedule = function (adSchedule) {
var result = {};
View Modal.js (hoc)
import React, { Component, PropTypes } from 'react';
import ReactDOM from 'react-dom';
import round from 'modules/rounder';
import Icon from 'components/Icon';
import getDisplayName from 'react-display-name';
const Modal = (content = null) => ComposedComponent => class extends Component {
static displayName = ComposedComponent
? `Modal(${getDisplayName(ComposedComponent)})`
: null;
View Styling the shadow DOM the hacky way.js
const shadow = myElement.createShadowRoot();
const style = document.createElement('style');
style.innerHTML = '@import url(PATH_TO_MY_CSS)';
shadow.appendChild(style);