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 / favicon.php
Last active April 22, 2021 22:33
favicon html code for all browsers (got from http://www.sitepoint.com/favicon-a-changing-role/ )
<?php $favicon_path = "/docroot/img/ico/"; ?>
<!-- Default -->
<link rel="shortcut icon" href="<?php echo $favicon_path; ?>favicon.ico"/>
<!-- For IE6+ -->
<link rel="shortcut icon" href="<?php echo $favicon_path; ?><?php echo $favicon_path; ?>favicon.ico" type="image/x-icon">
<!-- For IE6+ -->
<link rel="shortcut icon" href="<?php echo $favicon_path; ?>favicon.ico">
@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 / st3-sf2-template.sublime-project
Last active June 11, 2018 07:50
Sublime Text 3 project file template for Symfony2
{
"folders":
[
{
"follow_symlinks": true,
"path": "/",
"folder_exclude_patterns": [
".sass-cache",
"app/cache",
"bin",
@ifthenelse
ifthenelse / Show---Hide-full-size-divs-with-translate.markdown
Last active August 25, 2017 09:16
Hide and show full size DIV containers with CSS3 transitions on translate, rather than top, right, bottom, or left offset.

Show / Hide full size divs with translate

Hide and show full size DIV containers with CSS3 transitions on translate, rather than top, right, bottom, or left offset.

A Pen by Andrea Collet on CodePen.

License.