Skip to content

Instantly share code, notes, and snippets.

View ifthenelse's full-sized avatar
🏎️
LIFE BE LIKE

Andrea Collet ifthenelse

🏎️
LIFE BE LIKE
View GitHub Profile
@ifthenelse
ifthenelse / check_binance_authenticated_api_request.zsh
Last active January 30, 2024 14:02
Small script that uses jq to check the success of an authenticated request to Binance API key with the API key and Secret used in a specific Freqtrade configuration file. Usage ./check_binance_authenticated_api_request.zsh path/to/your-ftbot-config-file.json
#!/bin/zsh
# Check if jq is installed
if ! command -v jq &> /dev/null; then
echo "Error: jq is not installed. Please install it before continuing."
exit 1
fi
# Check if a configuration file name is provided
if [[ -z $1 ]]; then
@ifthenelse
ifthenelse / freqtrade_docker_bots_strategy_update_cronjob
Last active January 29, 2024 07:55
freqtrade docker bots strategy update cronjob
#!/bin/zsh
# Force pairlist/blacklists and strategies update?
FORCEUPDATE=0
# Add git commits
ADDGITCOMMITS=0
# Default root path
ROOT_PATH="${HOME}"
@ifthenelse
ifthenelse / tinyInspector.js
Last active November 14, 2019 04:39
A cross-browser tiny DOM inspector to use as a bookmarklet when inspection on is forbidden
function onTinyInspectorMouseOver(evt) {
if (evt.target == p || evt.target == c) { return; }
p.innerHTML = evt.target.tagName + " " + evt.target.className;
c.innerHTML = window.getComputedStyle(evt.target).getPropertyValue("width") + " x " + window.getComputedStyle(evt.target).getPropertyValue("height");
evt.target.style.backgroundColor = "rgba(255, 0, 0, 0.15)";
evt.target.style.border = "1px solid rgba(255, 0, 0, 0.5)";
}
function onTinyInspectorMouseOut(evt) {
if (evt.target == p || evt.target == c) { return; }
@ifthenelse
ifthenelse / webvideo.zsh
Created November 16, 2018 13:32
Create compressed versions of video in mp4 and webm formats using zsh and ffmpeg
#!/bin/env zsh
# create webm and mp4 web version of video
webvideo() {
if [ -z "$1" ]; then
printf "\Video source not set\n"
exit 1
fi
SOURCE="$1"
@ifthenelse
ifthenelse / wordpress-docker.sublime-project
Created September 26, 2018 12:07
wordpress-docker.sublime-project
{
"folders": [
{
"file_exclude_patterns": [
"*.sublime-*",
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
@ifthenelse
ifthenelse / jquery.getTransitionDuration.js
Last active September 4, 2018 09:13 — forked from mandelbro/jQuery-transitionend
Quick jQuery plugin to get the duration of a CSS transition for an element. Support multiple transition values
/**
* jQuery.getTransitionDuration
* A jQuery plugin to get transition-duration in milliseconds
* Works with multiple values and supports all browser vendor prefixes
*
* Usage with single transition-duration values $(div).getTsDuration()
* Usage with multiple transition-duration values $(div).getTsDuration("opacity") (otherwise would return the first)
*
* Based on a gist by Chris Montes https://gist.github.com/mandelbro/4067903
*/
@ifthenelse
ifthenelse / jQuery_plugin_UMD_boilerplate.js
Last active July 19, 2018 10:44
Boilerplate for jQuery plugin with UMD wrapper and requiremetn of external dependencies (in this case 'moment' and 'moment-timezone')
(function(factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery', 'moment', 'moment-timezone'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = function(root, jQuery, moment) {
if (jQuery === undefined) {
// require('jQuery') returns a factory that requires window to
// build a jQuery instance, we normalize how we use modules
@ifthenelse
ifthenelse / Dynamic grid layout in SASS
Created June 27, 2017 16:23
Programmatically stack SASS breakpoints in a json-like structure and use them to create a grid system layout
$smallphone: 480px;
$phone: 640px;
$tablet: 768px;
$desktop: 1024px;
$wide: 1440px;
// Grid breakpoints map
$breakpoints: (small: null, medium: "screen and (min-width: 768px)", large: "screen and (min-width: 1440px)");
// Non-grid breakpoints map
alias nom='npm cache clean && rm -rf node_modules && mkdir node_modules && tmutil addexclusion $(pwd)/node_modules && touch node_modules/.metadata_never_index && npm install'
alias bom='bower cache clean && rm -rf bower_components && mkdir bower_components && tmutil addexclusion $(pwd)/bower_components && touch bower_components/.metadata_never_index && bower install'
@ifthenelse
ifthenelse / riepilogo.html
Created June 9, 2016 17:59
Header riepilgoo checkout
<section class="shop-checkout--cart section-without-vertical-margin layout-grid is-active">
<div class="row">
<div class="col small-12 medium-8 medium-shift-2 large-6 large-shift-3">
<header class="shop-checkout--cart--header">
<h2>Riepilogo ordini</h2>
</header>
<article id="cart-item-riso" class="shop-checkout--cart-item">
<div class="shop-checkout--cart-item--info riepilogo">
<p class="shop-checkout--cart-item--name bentonsanslight__big uppercase">
<span class="bentonsansbold">5 x</span> <a href="/shop-categoria.html" title="Riso" target="_self" class="shop-checkout--cart-item--link">Riso</a>