Skip to content

Instantly share code, notes, and snippets.

@nmalayev
nmalayev / saveToPlaylist.js
Created February 28, 2022 18:16
YouTube Music Likes to Playlist
// Define the sleep method and relevant paths.
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
const sleepTime = 600;
const count = 0;
// Update playlistName to desired playlist
const playlistName = "#####";
@prologic
prologic / LearnGoIn5mins.md
Last active July 3, 2024 04:05
Learn Go in ~5mins
@Intyre
Intyre / Wahoo_Elemnt.md
Last active June 25, 2024 14:44
Wahoo Elemnt - Tips, tricks and custom images
@bastman
bastman / application.yml
Created February 11, 2018 08:06
spring-boot jpa hibernate postgres fix: LobCreatorBuilderImpl : HHH000424: Disabling contextual LOB creation as createClob() method threw error
# LobCreatorBuilderImpl : HHH000424: Disabling contextual LOB creation as createClob() method threw error
# see: http://vkuzel.blogspot.de/2016/03/spring-boot-jpa-hibernate-atomikos.html
# Disable feature detection by this undocumented parameter. Check the org.hibernate.engine.jdbc.internal.JdbcServiceImpl.configure method for more details.
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults: false
# Because detection is disabled you have to set correct dialect by hand.
spring.jpa.database-platform: org.hibernate.dialect.PostgreSQL9Dialect
@sagrawal31
sagrawal31 / formatSeconds.groovy
Created February 24, 2017 10:53
A simple Java/Groovy code to convert a given seconds value to hh:mm:ss format
import java.util.concurrent.TimeUnit
void convert(int secondsToConvert) {
long millis = secondsToConvert * 1000;
long hours = TimeUnit.MILLISECONDS.toHours(millis);
long minutes = TimeUnit.MILLISECONDS.toMinutes(millis) % TimeUnit.HOURS.toMinutes(1);
long seconds = TimeUnit.MILLISECONDS.toSeconds(millis) % TimeUnit.MINUTES.toSeconds(1);
String format = String.format("%02d:%02d:%02d", Math.abs(hours), Math.abs(minutes), Math.abs(seconds));
@sanukin39
sanukin39 / XcodeSettingsPostProcesser.cs
Last active October 11, 2023 16:04
Unity XcodeAPI Settings Sample
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.iOS.Xcode;
using UnityEditor.Callbacks;
using System.Collections;
public class XcodeSettingsPostProcesser
{
@devStepsize
devStepsize / slack_webhook_post.py
Last active August 7, 2023 09:28
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@pdib
pdib / .ebextensions\deploy.config
Last active April 5, 2022 07:39
Installing node and npm on a Django AWS ElasticBeanstalk
# This specifies the deployment process on AWS ElasticBeanstalk for a Django app using npm and Postgres.
#
# The target environment should have access to a Postgres Database through environment variables.
# The environment can be setup using `eb create --database.engine=postgres`
# The necessary environment variables to access the database will be automatically defined on the
# instances of that environment.
#
# In addition, the target environment should define environment variables (django secret key ...).
# They can be manually defined using the AWS ElasticBeanstalk interface on the web.
# They can also be specified when creating the environment from command line, for example:

Git Cheat Sheet

Commands

Getting Started

git init

or