Skip to content

Instantly share code, notes, and snippets.

View Bukashk0zzz's full-sized avatar
👽
Out of space

Denis Golubovskiy Bukashk0zzz

👽
Out of space
View GitHub Profile
@penguinboy
penguinboy / Object Flatten
Created January 2, 2011 01:55
Flatten javascript objects into a single-depth object
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;
@mathieue
mathieue / 6379.conf
Last active April 23, 2022 16:23
redis conf with disk persistance
## Generated by install_server.sh ##
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
@corny
corny / apt-upgrade.yml
Created August 11, 2015 23:35
Ansible playbook that uses apt to upgrade packages and remove/purge unneeded packages
---
- hosts: all
environment:
LC_ALL: C
LANG: C
tasks:
- name: Update APT package cache
apt: update_cache=yes cache_valid_time=600
<?php
namespace ExampleBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
use ExampleBundle\Entity\ExampleTranslation; // is a Personal Translation
class ExampleAdmin extends Admin
{
/**
@boussouira
boussouira / track.html
Last active May 2, 2021 11:12
Fire Facebook Pixel with for Free+Shipping Shopify Products
<script>
{% if first_time_accessed %}
var patchedTrack = function(type, data) {
data.revenue = "{{order.total_price | money_without_currency}}";
window.ShopifyAnalytics.lib.track2(type, data);
};
function patchTrack() {
if (window.ShopifyAnalytics &&
window.ShopifyAnalytics.lib &&
@danmaas
danmaas / alb-ingress-singleton.yaml
Last active October 3, 2019 15:50
Singleton ALB ingress controller fronting Nginx for Amazon EKS
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: "myALB"
labels:
app: "myALBApp"
annotations:
# trigger the alb-ingress-controller
kubernetes.io/ingress.class: "alb"
@psxvoid
psxvoid / delete-evicted-pods-all-namespaces.sh
Created August 6, 2018 14:41
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
#!/bin/sh
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d
# delete all evicted pods from all namespaces
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff state from all namespaces
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces
@hayes0724
hayes0724 / track.html
Created September 29, 2018 01:35
BigCommerce - GA Enhanced Ecommerce Tracking
<script type="text/javascript">
window.dataLayer = window.dataLayer||[];
function trackGTMEcommerce() {
this._addTrans = addTrans;
this._addItem = addItems;
this._trackTrans = trackTrans;
}
var transaction = {};
transaction.transactionProducts = [];