Skip to content

Instantly share code, notes, and snippets.

View corpulent's full-sized avatar

Artem Golub corpulent

  • South Dakota
View GitHub Profile
#wrokflow doc
{
"_id": "63761a9646ecc443c460069a5006b44b",
"_rev": "11-11813e6bff59bf0056bbc545dc2df3e0",
"type": "workflow",
"background": true,
"paginated": false,
"zip": true,
"steps": [
@iJackUA
iJackUA / install-redis-ubuntu.sh
Last active July 25, 2017 06:09
Install Redis from source (Ubuntu)
#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "ERROR : Run script as Root (sudo !!) please"
exit 1
fi
read -e -p "Redis version to be installed (change if needed) : " -i "2.8.2" VERSION
echo 'Installing redis v.'$VERSION' ... '
@bentasm1
bentasm1 / vendor-list.php
Created February 10, 2016 17:02
WC Vendors Pro - Sample template for [wcv_vendorslist] shortcode
<?php
// Copy this template to /themes/yourtheme/wc-vendors/front/vendor-list.php
// For more ways to customize this template, visit
// https://www.wcvendors.com/kb/customizing-wcv_vendorslist-for-pro/
// Get vendor store icon and show it as $store_icon, otherwise, show their avatar instead
$icon_id = get_user_meta( $vendor_id, '_wcv_store_icon_id', true );
$store_icon = wp_get_attachment_image_src( $icon_id );
if (isset ($store_icon[0]) ) {
@gjedeer
gjedeer / boto_sns.py
Created June 24, 2015 22:01
How to send a push notification directly to device using Python, Boto and SNS
import boto
import boto.exception
import boto.sns
import pprint
import re
def send_push(device_id, body):
region = [r for r in boto.sns.regions() if r.name==u'eu-west-1'][0]
sns = boto.sns.SNSConnection(
# API authentication
from social.apps.django_app.utils import strategy
from rest_framework.authtoken.models import Token
from rest_framework.views import APIView
from rest_framework import parsers
from rest_framework import renderers
from rest_framework.authentication import get_authorization_header
from rest_framework.response import Response
@chen206
chen206 / gist:4030441
Created November 7, 2012 09:45
Install Postgresql 9.2 on Ubuntu 12.04
#!/bin/bash
#
# Install Postgres 9.2 on a clean Ubuntu 12.04
"""
LC_ALL issue
comment out the AcceptEnv LANG LC_* line in the remote /etc/ssh/sshd_config file.
sudo apt-get install language-pack-en-base
sudo dpkg-reconfigure locales
comment out the SendEnv LANG LC_* line in the local /etc/ssh/ssh_config file.
@sjparkinson
sjparkinson / RDS-Aurora-CloudFormation-Example.yaml
Last active May 10, 2022 10:43
A basic CloudFormation template for an RDS Aurora cluster.
---
AWSTemplateFormatVersion: 2010-09-09
Description: >
A basic CloudFormation template for an RDS Aurora cluster.
Parameters:
DatabaseUsername:
AllowedPattern: "[a-zA-Z0-9]+"
ConstraintDescription: must be between 1 to 16 alphanumeric characters.
@tmaiaroto
tmaiaroto / Dockerfile
Last active June 30, 2022 08:48
WordPress on Amazon ECS
FROM alpine:3.3
MAINTAINER Tom Maiaroto <tom@outdoorsy.co>
# Install packages
RUN apk --update --repository http://dl-3.alpinelinux.org/alpine/edge/main add \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
php7 \
@bonzanini
bonzanini / create_index.sh
Last active May 25, 2023 23:35
Elasticsearch/Python test
curl -XPOST http://localhost:9200/test/articles/1 -d '{
"content": "The quick brown fox"
}'
curl -XPOST http://localhost:9200/test/articles/2 -d '{
"content": "What does the fox say?"
}'
curl -XPOST http://localhost:9200/test/articles/3 -d '{
"content": "The quick brown fox jumped over the lazy dog"
}'
curl -XPOST http://localhost:9200/test/articles/4 -d '{
@creachadair
creachadair / wake-on-change.md
Last active November 20, 2023 04:37
Waiting for a Value to Change in Go

Waiting for a Value to Change in Go

When multiple goroutines share access to a value that will periodically change, readers may wish to wait for a value to be updated before reading the value again. This can be solved using a condition variable:

var val *Thing
var mu = new(sync.Mutex)
var cond = sync.NewCond(mu)

func wait(old *Thing) *Thing {