Skip to content

Instantly share code, notes, and snippets.

@Auskennfuchs
Auskennfuchs / WeatherSystem.cs
Created August 25, 2018 23:15
Unity Weather System Controller
using System;
using UnityEngine;
public class WeatherSystem : MonoBehaviour
{
[Serializable]
public class Season
{
public float duration;
public Color lightColor;
@hujuice
hujuice / integration-manager-repository-hooks.md
Last active March 9, 2021 00:57
Integration manager repository Git hooks for a PHP project

Here are suggested hooks for integration manager repository, in a composer based PHP project.

The IM has all the developer hooks, more the prepare-commit-msg to intercept unwanted merges.

@erikhansen
erikhansen / 1_product_queries.sql
Last active July 16, 2025 20:08
Magento 2 - Remove duplicate store view-specific product and category data
/*
* IMPORTANT: The queries below are written for Magento Enterprise. If you're going to run them on Magento Community, you need
* to replace all instances of ".row_id" with ".entity_id". See this for context: http://magento.stackexchange.com/questions/139740/magento-2-schema-changes-for-ee-catalog-staging
*
* When importing products in Magento 2, if you specify store view codes in the store_view_code column, product data will be set at
* both the global scope as well as the specific store view scope. This is not ideal because now you have duplicate
* data at two different scopes that shouldn't actually be duplicated. The scripts below clean up this data by finding
* data set at specific store view scopes and if it's an exact match to the data set at the global store view, then it
* deletes the data set at the specific store view scope.
*
@Antoinebr
Antoinebr / defer-inline-js.html
Last active June 13, 2018 06:47
Tell inlines scripts to wait, that a function is defined https://goo.gl/DF6fWn
<!-- Put this function inline on the header -->
<script>
function whenAvailable(name, callback) {
var interval = 10; // ms
window.setTimeout(function() {
if (window[name]) {
callback(window[name]);
} else {
window.setTimeout(arguments.callee, interval);
}
@balloz
balloz / fix-downloader.diff
Created October 17, 2016 08:05
Fix Magento Connect SSL version
diff --git a/downloader/lib/Mage/HTTP/Client/Curl.php b/downloader/lib/Mage/HTTP/Client/Curl.php
index a777beb..1a39b19 100644
--- a/downloader/lib/Mage/HTTP/Client/Curl.php
+++ b/downloader/lib/Mage/HTTP/Client/Curl.php
@@ -380,7 +380,7 @@ implements Mage_HTTP_IClient
* @link http://php.net/manual/ru/function.curl-setopt.php
*/
- $this->curlOption(CURLOPT_SSLVERSION, 1);
+ $this->curlOption(CURLOPT_SSLVERSION, 5);
@balloz
balloz / fix-broken-unserialize.diff
Last active August 19, 2019 14:01
Fix broken unserialize in Magento SUPEE-8788 patch
diff --git a/lib/Unserialize/Parser.php b/lib/Unserialize/Parser.php
index 20a6a3c..88c6555 100644
--- a/lib/Unserialize/Parser.php
+++ b/lib/Unserialize/Parser.php
@@ -34,6 +34,7 @@ class Unserialize_Parser
const TYPE_DOUBLE = 'd';
const TYPE_ARRAY = 'a';
const TYPE_BOOL = 'b';
+ const TYPE_NULL = 'N';
@jjgrainger
jjgrainger / Vector.js
Last active February 11, 2026 09:05
A simple Vector class in javascript
var Vector = function(x, y) {
this.x = x || 0;
this.y = y || 0;
};
// return the angle of the vector in radians
Vector.prototype.getDirection = function() {
return Math.atan2(this.y, this.x);
};
@colinmollenhour
colinmollenhour / Varien.php
Last active July 19, 2024 09:25
Mage_Core_Model_Session_Abstract_Varien - dropped session fix
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
var p1={
x:0,
y:0
};
var p2={
x:0,
y:1
};
@helderco
helderco / db-open
Created October 6, 2015 14:51
Script to open a mysql database in Sequel Pro from a service in docker-compose.
#!/bin/bash
set -e
show_help() {
cat << EOF
Usage: ${0##*/} [-u USER] [-p PASS] [-P PORT] [-H HOST] [DATABASE]
${0##*/} -h
Open a standard connection in Sequel PRO.