Skip to content

Instantly share code, notes, and snippets.

View naimurhasan's full-sized avatar
🏠
Working from home

Naimur Hasan naimurhasan

🏠
Working from home
View GitHub Profile
@bizz84
bizz84 / update-android-project.sh
Last active May 30, 2025 18:58
Script to update Gradle, Java and other Android project settings in a Flutter project
#!/bin/bash
# Update Gradle, Java and other Android project settings in a Flutter project
# Works with both .gradle and .gradle.kts build files
# See: https://gradle.org/releases/
# See: https://developer.android.com/build/releases/gradle-plugin#compatibility
DESIRED_GRADLE_VERSION="8.11.1"
# Build errors often show the required Java version
DESIRED_JAVA_VERSION="17"
# See: https://developer.android.com/ndk/downloads
@dragonfire1119
dragonfire1119 / install-ha-docker-compose.yaml
Created July 15, 2023 17:39
Install Home Assistant on Portainer
---
version: "2.1"
services:
homeassistant:
image: lscr.io/linuxserver/homeassistant:latest
container_name: homeassistant
network_mode: host
environment:
- PUID=1000
- PGID=1000
@olar94
olar94 / lol.php
Created September 4, 2018 14:11
Add product to cart and setting up custom price | woocommerce
global $woocommerce;
$woocommerce->cart->empty_cart(); //чистим
$custom_price = $price; //$price - переменная с ценой
$product_id = 11963; //id любого товара
$quantity = 1; //кол-во
$cart_item_data = array('custom_price' => $custom_price);
$woocommerce->cart->add_to_cart( $product_id, $quantity, $variation_id, $variation, $cart_item_data );
$woocommerce->cart->calculate_totals();
$woocommerce->cart->set_session();
$woocommerce->cart->maybe_set_cart_cookies();
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
@henriquemenezes
henriquemenezes / postgresql-set-id-seq.sql
Created March 31, 2016 12:23
PostgreSQL set Next ID Sequence Value to MAX(id) from Table
-- Get Max ID from table
SELECT MAX(id) FROM table;
-- Get Next ID from table
SELECT nextval('table_id_seq');
-- Set Next ID Value to MAX ID
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
@lopspower
lopspower / README.md
Last active May 31, 2025 23:11
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@atupal
atupal / select_input.py
Created June 26, 2013 06:36
Keyboard input with timeout in Python
import sys, select
print "You have ten seconds to answer!"
i, o, e = select.select( [sys.stdin], [], [], 10 )
if (i):
print "You said", sys.stdin.readline().strip()
else:
print "You said nothing!"