Skip to content

Instantly share code, notes, and snippets.

stfeng2 /
Last active May 6, 2021
Cloud SQL Flags Tuning

Important Notice

  • All flags and settings described here are subject to change without any notice.
  • Last update: September 2017


This document describes a set of MySQL flags that have been tuned in Google Cloud SQL (Second Generation) to make the out-of-box experience better on Google Cloud. This is for your reference only, with the hope that some of the settings might also be useful outside the Google Cloud environment.


alekseykulikov /
Last active Aug 8, 2020
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

View gist:6d8fc3fd0d67b6470f7d
Blog post: Ryan Huber - Distributed Security Alerting
Video: Zane Lackey - Building a Modern Security Organization
Krebs on Security Blog
Sony Breach
amitsaxena / gist:9cb0712e572c39a41edc
Last active Oct 24, 2019
CustomURL: Launch app if app is installed, else open an alternate URL (Android all browsers)
View gist:9cb0712e572c39a41edc
<script type="text/javascript">
var custom = "myapp://custom_url";
var alt = "";
var g_intent = "intent://scan/#Intent;scheme=zxing;;end";
var timer;
var heartbeat;
var iframe_timer;
function clearTimers() {
View Facebook Lookback Downloader
var xLBD = {};
xLBD.c = function (){
xLBD.f = unescape(document.querySelector("[flashvars]").getAttribute("flashvars")).substring(7);
xLBD.f = JSON.parse(xLBD.f.substring(0, xLBD.f.lastIndexOf("}") + 1)).video_data[0].hd_src;
xLBD.a = "<div style='position:absolute;top:100px;height:300px;left:15%;background:#fff;border:10px solid #000;font-size:5em;padding:100px;'>Click <a download='lookback.mp4' href='"+xLBD.f+"'>here<\/a> to download your lookBack video.</div>";
document.body.innerHTML += xLBD.a;
if(document.readyState == "complete")
else window.onload = xLBD.c;
amitsaxena / gist:8601424
Last active Oct 18, 2019
CustomURL: Launch app if app is installed, else open an alternate URL (iOS all browsers)
View gist:8601424
<script type="text/javascript">
var timer;
var heartbeat;
var lastInterval;
function clearTimers() {
rasschaert / nsq-0.2.24.linux-amd64.go1.2.tar.gz-to-rpm.bash
Last active Jan 3, 2016
Creates an RPM package for NSQ (distributed messaging platform written in Golang). Tested on CentOS 6 x86_64 with EPEL and Golang 1.2.
View nsq-0.2.24.linux-amd64.go1.2.tar.gz-to-rpm.bash
echo 'Downloading pre-built binaries'
echo 'Extracting archive'
tar xzf nsq-0.2.24.linux-amd64.go1.2.tar.gz
echo 'Creating correct directory structure'
mkdir -p nsq-0.2.24.linux-amd64.go1.2/usr/local/
mv nsq-0.2.24.linux-amd64.go1.2/{bin,share} nsq-0.2.24.linux-amd64.go1.2/usr/local/
kr / pre-commit
Last active Nov 11, 2016
Here's a goimports git pre-commit hook.Put this file in .git/hooks.
View pre-commit
#!/usr/bin/env bash
# Redirect output to stderr.
exec 1>&2
# list staged go files
# ignore trees starting with "_", like the go tool
lsgo() {
git ls-files|egrep '.*[.]go$'|fgrep -v /_
tmcw / index.html
Created Dec 14, 2012
Unknown Pleasures
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
body {
font: 10px sans-serif;
margin:0 auto;
mbostock / .block
Last active Feb 9, 2016 — forked from dchud/
View .block
license: gpl-3.0