Skip to content

Instantly share code, notes, and snippets.

View pschfr's full-sized avatar

Paul Schaefer pschfr

View GitHub Profile
{
"basics": {
"name": "Paul Schaefer",
"label": "Programmer",
"picture": "https://www.gravatar.com/avatar/434e1c10883e5ea54c5bfa918a1fa630",
"email": "hello@paulmakesthe.net",
"phone": "(412) 414-9939",
"website": "https://paulmakesthe.net/",
"summary": "",
"location": {
@pschfr
pschfr / calc.html
Last active October 12, 2018 19:12
One line data:text/html calculator from https://twitter.com/MaximeEuziere/status/1050823405728088065
<body onload='for(s of"C/=.0 *321 -654 +987 ")i.outerHTML+=s<"!"?"<p>":`<button onclick=F("${s}")>`+s;F=b=>i.value=z=b>"B"?(c=d=o="",a=r=p=0):1+b-0?c+=b-.1?b:d?"":d=b:(q=b<"=",p?r=c:a=c||a,r=q?p&&r:r||a,a=o&&r?z=eval(a+o+s+r):a,o=q?b:o,p=q,d=c="",q?z:a);F`C`'><input id=i>
@pschfr
pschfr / gulpfile.js
Created September 7, 2018 04:21
Simple Gulp file to deploy via FTP
var gulp = require('gulp'),
util = require('gulp-util'),
vftp = require('vinyl-ftp');
gulp.task('default', function() {
var conn = vftp.create({
host: 'domain.com',
user: 'username',
pass: 'password',
parallel: 8,

Ideas

  • Philips Hue bulb for Alexa / Google Home control
  • USB ports (~4) and an outlet
    • build charging cords or wireless charging pad into design?
  • Slightly more weather resistant than previous model
  • Look better than the conduit box design
    • wood or Lego case?
    • drawers or shelves?
@pschfr
pschfr / imagick.php
Last active September 7, 2018 04:27
[ImageMagick Resize] #PHP #Imagemagick
<?php
try {
// a new imagick object
$im = new Imagick($imagePath);
// Resizes using the Lanczos resampling algorithm to whichever is larger, width or height
if($im->getImageHeight() <= $im->getImageWidth()) {
// width is larger, resize if larger than max
if ($im->getImageWidth() >= 800) {
$im->resizeImage($width, 0, Imagick::FILTER_LANCZOS, 1);