Skip to content

Instantly share code, notes, and snippets.

@ih2502mk
ih2502mk / list.md
Last active January 11, 2025 23:03
Quantopian Lectures Saved
@pratikbutani
pratikbutani / country-flag.json
Created October 9, 2020 10:05
A JSON for Country List with Flag Image
[
{
"flag": "https://twemoji.maxcdn.com/2/svg/1f1e6-1f1e8.svg",
"country": "Ascension Island",
"code": "ac"
},
{
"flag": "https://twemoji.maxcdn.com/2/svg/1f1e6-1f1e9.svg",
"country": "Andorra",
"code": "ad"
@jcoutch
jcoutch / bt_light_control.sh
Created March 12, 2022 05:03
Bluetooth Light Strip Control
#!/bin/bash
# Based on information found at the following URLs:
# https://stackoverflow.com/questions/46169415/understanding-hsl-to-rgb-color-space-conversion-algorithm
# https://community.home-assistant.io/t/controlling-a-bluetooth-led-strip-with-ha/286029/5
# Parameters:
# bt_light_control.sh MAC_ADDRESS STATE PARAMETERS
#
# Turn on: bt_light_control.sh 00:00:00:00:00:00 on
@amir00462
amir00462 / yaghootFlutter_dart_example2.dart
Created August 19, 2023 17:43
code of creating a menu in dart using while and functions and switch case
// Example2 , yaghoot flutter , by AmirHosseinMohammadi
import 'dart:io';
welcome() {
print("Welcome to my app :) ");
print("this app helps you have a better life");
print("\nchoose an option below : ");
print("1. admin panel");
print("2. user panel");
@MadStool
MadStool / gist:227faa6c72ac498905b1771273ffb251
Last active January 11, 2025 22:52
аквариум про креветку в пивной кружке
using System;
using System.Collections.Generic;
using System.Threading;
namespace AquariumSimulation
{
internal class Program
{
static void Main(string[] args)
{
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active January 11, 2025 22:50
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@igorbenic
igorbenic / add_metabox.php
Last active January 11, 2025 22:49
How to use the WordPress Code Editor in your Plugins or Themes | https://www.ibenic.com/wordpress-code-editor
<?php
add_action( 'add_meta_boxes', 'add_page_scripts' );
/**
* Register the metabox
*/
function add_page_scripts() {
add_meta_box( 'page-scripts', __( 'Page Scripts & Styles', 'textdomain' ), 'add_page_metabox_scripts_html', 'page', 'advanced' );
}
@littensy
littensy / use-px.ts
Last active January 11, 2025 22:48
Roblox-TS React hook for responsive sizes
import { useCamera, useDebounceState, useEventListener } from "@rbxts/pretty-react-hooks";
import { useMemo } from "@rbxts/roact";
interface ScaleFunction {
/**
* Scales `pixels` based on the current viewport size and rounds the result.
*/
(pixels: number): number;
/**
* Scales `pixels` and rounds the result to the nearest even number.
@itsfrank
itsfrank / codecompanion-save.lua
Last active January 11, 2025 22:44
Snippet to add the ability to save/load CodeCompanion chats in neovim
-- add 2 commands:
-- CodeCompanionSave [space delimited args]
-- CodeCompanionLoad
-- Save will save current chat in a md file named 'space-delimited-args.md'
-- Load will use a telescope filepicker to open a previously saved chat
-- create a folder to store our chats
local Path = require("plenary.path")
local data_path = vim.fn.stdpath("data")
local save_folder = Path:new(data_path, "cc_saves")