Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# e.g. CONTAINER_REGISTRY=asia.gcr.io/your-project-name/gcf/asia-northeast1
CONTAINER_REGISTRY=`WRITE YOUR REGISTRY NAME`
IMAGE_LIST=`gcloud container images list --repository=$CONTAINER_REGISTRY | awk 'NR!=1'`
for line in $IMAGE_LIST; do
gcloud container images delete "$line/worker" --quiet & gcloud container images delete "$line/cache" --quiet &
done
@sergioviniciusp
sergioviniciusp / Query.SQL
Last active May 1, 2021 15:42
Query - DeiUmTempo
SELECT
PROFILES.ID AS profile_id,
USUARIO.ID AS ID_USER,
USUARIO.NICKNAME,
USUARIO.BIRTHDAY,
USUARIO.GENDER,
DATE(USUARIO.CREATED_AT) AS CREATED_AT,
USUARIO.EMAIL,
USUARIO.NAME AS NOME_USR,
PLANO.DURATION,
@OrenBochman
OrenBochman / TagSpider.py
Created January 9, 2017 11:02 — forked from cspenn/TagSpider.py
GA/GTM Tag Checker in Python and Scrapy
# -*- coding: utf-8 -*-
# Copyright Christopher S. Penn, 2016 | cspenn.com | @cspenn
# This software is licensed under the GNU General Public License, version 3.0.
# Absolutely no warranty or support is provided.
# Run at your own risk.
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
@pylover
pylover / a2dp.py
Last active May 27, 2024 21:51
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@askn
askn / query_planner.markdown
Created May 4, 2016 14:22 — forked from hgmnz/query_planner.markdown
PostgreSQL query plan and SQL performance notes

Types of index scans

Indexes

Sequential Scan:

  • Read every row in the table
  • No reading of index. Reading from indexes is also expensive.
@gouthambs
gouthambs / minimal_luigi.py
Last active August 26, 2016 23:06
Minimal Luigi Example
# Minimal Luigi Example - Gouthaman Balaraman
# http://gouthamanbalaraman.com/blog/building-luigi-task-pipeline.html
import luigi
class SimpleTask(luigi.Task):
"""
This simple task prints Hello World!
"""
@matt-baker
matt-baker / select-centroid-polygon-as-latlong
Last active February 17, 2023 10:01
Select lat/long centroid from a polygon in PostGIS.
-- SELECT polygon centroid as latitude/longitude in PostGIS
SELECT
st_x(st_transform(ST_Centroid(the_geom),4326)) as lat,
st_y(st_transform(ST_Centroid(the_geom),4326)) as long
FROM table;
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@zhouming
zhouming / MY_Session.php
Created September 8, 2012 05:51
Use redis in Codeigniter Session.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Session extends CI_Session{
private $sess_use_redis = TRUE;
private $redis = '';
public function __construct($params = array()) {
//parent::__construct();
$this->CI =& get_instance();
# Taken from http://frst.in/~8r
# Configuration
set :application, "your.domain.com"
set :deploy_to, "/var/www/app"
set :repository, "git@github.com:username/project.git"
set :branch, "master"
set :user, "username"
# Additional SCM settings