Skip to content

Instantly share code, notes, and snippets.

@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
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:

@stfeng2
stfeng2 / cloud_sql_flags.md
Last active January 8, 2024 06:47
Cloud SQL Flags Tuning

Important Notice

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

Introduction

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.

innodb_buffer_pool_size

# Copyright (c) 2010, Philip Plante of EndlessPaths.com
#
# 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
Blog post: Ryan Huber - Distributed Security Alerting
https://medium.com/several-people-are-coding
Video: Zane Lackey - Building a Modern Security Organization
https://duo.com/blog/duo-tech-talk-building-a-modern-security-engineering-organization
Krebs on Security Blog
https://www.krebsonsecurity.com
Sony Breach
@amitsaxena
amitsaxena / gist:9cb0712e572c39a41edc
Last active October 24, 2019 12:37
CustomURL: Launch app if app is installed, else open an alternate URL (Android all browsers)
<script type="text/javascript">
var custom = "myapp://custom_url";
var alt = "http://mywebsite.com/alternate/content";
var g_intent = "intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;end";
var timer;
var heartbeat;
var iframe_timer;
function clearTimers() {
clearTimeout(timer);
@amitsaxena
amitsaxena / gist:8601424
Last active October 18, 2019 21:51
CustomURL: Launch app if app is installed, else open an alternate URL (iOS all browsers)
<script type="text/javascript">
var timer;
var heartbeat;
var lastInterval;
function clearTimers() {
clearTimeout(timer);
clearTimeout(heartbeat);
}
@bsparrow435
bsparrow435 / gist:3486140
Created August 27, 2012 06:15
Delete keys map reduce

#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 http://127.0.0.1:9000/buckets/test/keys/test$i -H "content-type: text/plain" -d "Data #$i\n"; done
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@burke
burke / ssh.rb
Created January 11, 2011 18:24
#!/usr/bin/env ruby
# Inspired by http://jeffmiller.github.com/2011/01/10/ssh-host-color
# == 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 Terminal.app's background colour to that colour.
# 5) Change the colour back when SSH exits.
@mbostock
mbostock / .block
Last active February 9, 2016 02:13 — forked from dchud/README.md
Streams
license: gpl-3.0