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.


# Copyright (c) 2010, Philip Plante of
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
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:

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() {
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() {
bsparrow435 / gist:3486140
Created Aug 27, 2012
Delete keys map reduce
View gist:3486140

#Map Reduce Delete Instructions

Set allow_strfun true on all nodes:

echo "rpc:multicall([node() | nodes()], application,set_env,[riak_kv,allow_strfun,true])." | bin/riak attach

Insert 15000 keys:

for i in {1..15000}; do curl -XPUT$i -H "content-type: text/plain" -d "Data #$i\n"; done
soemarko / theme.html
Created Nov 26, 2011
embed github gist to tumblr
View theme.html
<!-- Add the following lines to theme's html code right before </head> -->
<script src=""></script>
<script src=""></script>
<script src=""></script>
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist"></div>
View ssh.rb
#!/usr/bin/env ruby
# Inspired by
# == What this version does:
# 1) Launch an SSH process
# 2) Grab the IP that SSH connected to
# 3) Hash that IP and generate a colour from it
# 4) Change's background colour to that colour.
# 5) Change the colour back when SSH exits.
View gist:6d8fc3fd0d67b6470f7d
Blog post: Ryan Huber - Distributed Security Alerting
Video: Zane Lackey - Building a Modern Security Organization
Krebs on Security Blog
Sony Breach
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 /_