Skip to content

Instantly share code, notes, and snippets.

View mikeatm's full-sized avatar

Michael mikeatm

  • Technical University of Kenya
  • Nairobi
View GitHub Profile
@rsvp
rsvp / freqy.sh
Created February 18, 2012 15:43
freqy.sh : sort lines by their frequency count -- a very useful idiom as Linux bash script.
#!/usr/bin/env bash
# bash 3.2.25(1) Ubuntu 7.10 Date : 2012-02-15
#
# _______________| freqy : sort and order lines by frequency of appearance.
#
# Usage: freqy [optional: file(s)]
#
# Notes: Will work in a pipe.
# Does not alter the file(s) themselves.
#
@batok
batok / paramiko_example.py
Created April 10, 2012 16:11
Paramiko example using private key
import paramiko
k = paramiko.RSAKey.from_private_key_file("/Users/whatever/Downloads/mykey.pem")
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
print "connecting"
c.connect( hostname = "www.acme.com", username = "ubuntu", pkey = k )
print "connected"
commands = [ "/home/ubuntu/firstscript.sh", "/home/ubuntu/secondscript.sh" ]
for command in commands:
print "Executing {}".format( command )
@Snegovikufa
Snegovikufa / m2crypto_example.py
Last active December 8, 2021 14:33
m2crypto examle
# Since I ask this of people before using their code samples, anyone can
# use this under BSD.
import os
import M2Crypto
def empty_callback():
return
# Seed the random number generator with 1024 random bytes (8192 bits)
@d3noob
d3noob / .block
Last active September 16, 2020 09:18
Map using leaflet.js and d3,js combined
license: mit
@d3noob
d3noob / .block
Last active January 21, 2020 23:56
Map using leaflet.js and d3,js overlaid
license: mit
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dfletcher
dfletcher / tsws
Last active July 21, 2018 12:47
Totally simple web server using Bash and netcat (nc)
Moved to a proprer repositoy, TSWS is a real boy now!
https://github.com/dfletcher/tsws
PRs welcomed.
@t-nissie
t-nissie / 00anatase.en.md
Last active October 7, 2018 23:44
Quantum EspressoでTiO2アナターゼの電子のバンド構造とDOSを描く

Plot band structure and DOS of TiO2 anatase

Original files are in https://gist.github.com/t-nissie/ad99810ddf1bceb602f6 .

Preparation

  • Clone files in the gist as git clone https://gist.github.com/ad99810ddf1bceb602f6.git anatase08-k6x6x4-band-dos-gist.
  • cd anatase08-k6x6x4-band-dos-gist.
  • Get O.pw-mt_fhi.UPF and Ti.pw-mt_fhi.UPF form http://www.quantum-espresso.org/pseudopotentials/ .
  • Make symlinks to bands.x, dos.x, plotband.x and pw.x in the current directory, i.e. ln -s /SOMEWHERE/espresso-5.1.2/bin/bands.x.

The issue:

..mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.

(from a new defunct https://developers.google.com/mobile/articles/fast_buttons article)

touch-action CSS property can be used to disable this behaviour.

touch-action: manipulation The user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.