Skip to content

Instantly share code, notes, and snippets.

View eduwass's full-sized avatar
❄️
working remotely

Edu Wass eduwass

❄️
working remotely
View GitHub Profile
@eduwass
eduwass / 0. Custom Date Formats in Rails.md
Last active June 7, 2021 22:32
Custom Date Formats in Rails

Custom Date Formats in Rails

Quick guide on printing pretty dates in Rails

@MoOx
MoOx / isDblTouchTap.js
Last active April 30, 2023 19:28
Double touch tap workaround for React based on onTouchTap (react-tap-event-plugin)
const dblTouchTapMaxDelay = 300
let latestTouchTap = {
time: 0,
target: null,
}
export default function isDblTouchTap(event) {
const touchTap = {
time: new Date().getTime(),
target: event.currentTarget,
@Val
Val / build_rest-like_api.rb
Created January 19, 2016 14:28
Token protected REST-like API using Grape, Swagger on top of Rails. Based on http://www.toptal.com/ruby/grape-gem-tutorial-how-to-build-a-rest-like-api-in-ruby/
# -*- mode:ruby;tab-width:2;indent-tabs-mode:nil;coding:utf-8 -*-
# vim: ft=ruby syn=ruby fileencoding=utf-8 sw=2 ts=2 ai eol et si
#
# build_rest-like_api.rb: sample REST-like API server
# (c) 2016 Laurent Vallar <val@zbla.net>, WTFPL license v2 see below.
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
@eduwass
eduwass / commands.md
Last active December 21, 2016 13:50
Docker cheatsheet

Stop / remove all Docker containers

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

Remove dangling Docker images

docker rmi $(docker images -q -f dangling=true)
@iammerrick
iammerrick / PinchZoomPan.js
Last active April 22, 2024 02:54
React Pinch + Zoom + Pan
import React from 'react';
const MIN_SCALE = 1;
const MAX_SCALE = 4;
const SETTLE_RANGE = 0.001;
const ADDITIONAL_LIMIT = 0.2;
const DOUBLE_TAP_THRESHOLD = 300;
const ANIMATION_SPEED = 0.04;
const RESET_ANIMATION_SPEED = 0.08;
const INITIAL_X = 0;
@vbuck
vbuck / gist:ee728c235f258d99552000c463c41e6b
Created October 18, 2016 20:34
WP Smush "Bulk Smush Pusher"
// Execute in your console while WP Smush is open to bulk smush in intervals of 50 automatically
var smushTimer = setInterval( function() { !jQuery('.wp-smush-button').attr('disabled') ? jQuery('.wp-smush-button').click() : console.log('smush-check'); }, 3000);
@cassus
cassus / Dev platform settings
Created November 1, 2016 14:54
Zapier app to read Activity and Sleep data from FitBit
## Triggers (Bringing data into Zapier)
### Sleep - polling
https://api.fitbit.com/1/user/-/sleep/date/today.json
### Activity - polling
https://api.fitbit.com/1/user/-/activities/list.json?beforeDate=today&sort=desc&limit=10&offset=0
## Scripting API
see script.js
@blvz
blvz / gh-deploy-clone.sh
Last active August 23, 2023 23:15
Creates a deploy key and clones the repository.
#!/usr/bin/env bash
read -r -d '' usage << EOM
Usage:
gh-deploy-clone user/repo [ENVIRONMENT]
EOM
[ -z "$1" ] && echo && echo "$usage" && echo && exit 1
@marcosnakamine
marcosnakamine / script.js
Created October 24, 2017 13:28
jQuery - WP Smush auto click
setInterval(function(){
botao = jQuery('#wp-smush-bulk-wrap-box > div.box-container > div.wp-smush-bulk-wrapper > button');
if( botao.attr('disabled') != 'disabled' ) {
botao.trigger('click');
}
}, 1000);
@ahmadawais
ahmadawais / flywheel-local-xdebug-vscode.md
Last active May 3, 2024 12:07
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install