Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections;
public class LightmapPixelPicker : MonoBehaviour {
public Color surfaceColor;
public float brightness1; // http://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color
public float brightness2; // http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
public LayerMask layerMask;
@adilsoncarvalho
adilsoncarvalho / README.md
Last active August 22, 2022 12:00
Deploying a firebase function from Bitbucket pipelines

Deploying functions from Bitbucket Pipelines

It's quite easy and the same process applies to all Firebase features with minor changes.

Acquire a deployment token

In order to deploy you'll need a deployment token (I named it FIREBASE_TOKEN) and it can be acquired by using the following command

firebase login:ci

@martinusso
martinusso / Barcode.php
Last active July 9, 2020 01:48
Interleaved 2 of 5 Barcode implemented in PHP
<?php
namespace Boleto;
class Barcode
{
/**
* Generate Barcode
*
* @param $value Código de barras em dígitos
@jonatanrdsantos
jonatanrdsantos / magento-groupby.md
Created December 17, 2015 13:47
Magento: Wrong count in admin Grid when using GROUP BY clause, overriding lib module

Magento when you use GROUP BY clause in any Grid.php file in admin, the count always display wrong. Many times it displays 1 even if there are hundreds of records. Due to this your pagination also doesn’t work. This is a bug in Magento. Your getSize() always returns wrong count whereas total records in grid are proper.

To fix this, you need to edit one of your core file. As it’s not a good practice to edit core file, we will here override the core file. Overriding LIB module

Create a rewrite to yout collection main.table:

Mage_[MODULE]Model_Resource[RESOURCENAME]_Grid_Collection

And rewrite getSelectCountSql function with below one:

@nestoru
nestoru / Solution for mysql Warning: Using a password on the command line interface can be insecure
Last active October 23, 2021 21:20
Solution for mysql Warning: Using a password on the command line interface can be insecure
# Let us consider the following typical mysql backup script:
mysqldump --routines --no-data -h $mysqlHost -P $mysqlPort -u $mysqlUser -p$mysqlPassword $database
# It succeeds but stderr will get:
# Warning: Using a password on the command line interface can be insecure.
# You can fix this with the below hack:
credentialsFile=/mysql-credentials.cnf
echo "[client]" > $credentialsFile
echo "user=$mysqlUser" >> $credentialsFile
echo "password=$mysqlPassword" >> $credentialsFile