Skip to content

Instantly share code, notes, and snippets.

Option 1: Fill all empty cells with a "N/A" and then use Conditional Formatting to make the text invisible. Or Option 2: Fill all empty cells with 0 and use an Excel setting to hide zero values.

Filling all empty cells:

  • Edit → Go To... → Special ... (On Windows: Home → Editing → Find & Select → Go To Special...)
  • Select "Blanks" and hit OK.
  • All blank cells are selected now. Don't click anything.
  • Type "N/A" or 0, and then hit Ctrl+Enter. This will insert the value into all selected cells.

Conditional Formatting to Hide "N/A"

@dsaiztc
dsaiztc / pagereload.js
Created June 1, 2017 12:54
Reload page on timeout.
function reloadPageOnTimeout(duration, display) {
var timer = duration, minutes, seconds;
setInterval(function () {
minutes = parseInt(timer / 60, 10);
seconds = parseInt(timer % 60, 10);
minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = seconds < 10 ? "0" + seconds : seconds;
display.text(minutes + ":" + seconds);
@dsaiztc
dsaiztc / google_json_guide.md
Created May 30, 2017 16:14
Google JSON API guide
@dsaiztc
dsaiztc / boto3_error..py
Created May 30, 2017 16:11
boto3 error management
import boto3
from botocore.exceptions import ClientError as BotoClientError
s3_client = boto3.client('s3')
s3_bucket = 'randombucket'
s3_key = 'randomkey'
try:
s3_result = s3_client.get_object(Bucket=s3_bucket, Key=s3_key)
except BotoClientError as e:
import base64
def encode(key, clear):
enc = []
for i in range(len(clear)):
key_c = key[i % len(key)]
enc_c = chr((ord(clear[i]) + ord(key_c)) % 256)
enc.append(enc_c)
return base64.urlsafe_b64encode("".join(enc))
// Shallow copy
var newObject = jQuery.extend({}, oldObject);
// Deep copy
var newObject = jQuery.extend(true, {}, oldObject);
git rm --cached mylogfile.log

For a directory:

git rm --cached -r mydirectory
@dsaiztc
dsaiztc / yowsup_error.md
Created May 28, 2017 11:11
global name 'YowsupEnv' is not defined

On yowsup/env/env.py change

class YowsupEnv(with_metaclass(YowsupEnvType, object)):

to

@six.add_metaclass(YowsupEnvType)

Little Things I Like to Do with Git

Written by Harry Roberts on CSS Wizardry.

I was chatting with Tim just the other day about how much I love Git—it’s such a powerful, elegant tool and it’s one I use the most often. I thought I would note down some useful little Git snippets that I use the most frequently.

Leaderboards

@dsaiztc
dsaiztc / reportlab.py
Created May 18, 2017 09:17
reportlab simple boilerplate
import reportlab.lib.colors as colors
from reportlab.lib.pagesizes import A4, landscape
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib.units import cm, inch
from reportlab.platypus import (Paragraph, SimpleDocTemplate, Spacer, Table,
TableStyle)
from reportlab.platypus.flowables import PageBreak
from reportlab.rl_config import defaultPageSize