Skip to content

Instantly share code, notes, and snippets.

View dotpot's full-sized avatar

Lukas Šalkauskas dotpot

  • Vilnius, Lithuania
View GitHub Profile

Keybase proof

I hereby claim:

  • I am dotpot on github.
  • I am d0tp (https://keybase.io/d0tp) on keybase.
  • I have a public key ASCE7Bo3CFFQIGrc-P8V8XYfbMxT2eUk-C5ImAesF_5BQAo

To claim this, I am signing this object:

@dotpot
dotpot / README.md
Created July 12, 2018 07:23 — forked from rantav/README.md
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@dotpot
dotpot / UninstallBoomDevice.scpt
Created June 6, 2017 11:43
Uninstall BoomDevice (Mac) apple script.
on run
do shell script "sudo kextunload -b com.globaldelight.driver.BoomDevice" with administrator privileges
do shell script "sudo rm -rf /System/Library/Extensions/BoomDevice.kext" with administrator privileges
do shell script "sudo rm -rf /Library/Extensions/BoomDevice.kext" with administrator privileges
end run
@dotpot
dotpot / app.py
Created January 17, 2017 10:39 — forked from jmvrbanac/app.py
Using Jinja2 with Falcon
import os
import falcon
import jinja2
def load_template(name):
path = os.path.join('templates', name)
with open(os.path.abspath(path), 'r') as fp:
return jinja2.Template(fp.read())
@dotpot
dotpot / springer-free-maths-books.md
Created December 28, 2015 21:51 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@dotpot
dotpot / temp.py
Last active August 29, 2015 14:23 — forked from Paulius-Maruska/temp.py
def space(s, n):
"""inserts a space every n characters in string s
>>> space('0123456789', 3)
'012 345 678 9'
>>> space('0123456789', 4)
'0123 4567 89'
"""
return ' '.join(s[i:i+n] for i in range(0, len(s), n))

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google