layout: false .left-column[
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dotp; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.KeyEvent; | |
import com.facebook.react.LifecycleState; | |
import com.facebook.react.ReactInstanceManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'rotp' | |
# This is a script to use two factor authentication with public ssh keys (since you can't use PAM (g2fa) and public keys) | |
# You must refrence this script in your sshd config: ForceCommand="/usr/bin/two_factor_ssh" | |
# The script has to be executible by the user logging in | |
# get the username of the user logging in | |
user = ENV["USER"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
projectName=${PWD##*/} # Basename of current dir | |
gitRemote=~/Dropbox/src/${projectName}.git | |
echo "Creating bare repo in ${gitRemote}" | |
git init --bare ${gitRemote} | |
echo "Adding new remote 'dropbox'" | |
git remote add dropbox ${gitRemote} | |
git remote -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am mdp on github. | |
* I am mdp (https://keybase.io/mdp) on keybase. | |
* I have a public key whose fingerprint is E1E8 7928 C499 5D0A E31D 1514 D4BF DAC7 74ED EA2A | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am mdp on github. | |
* I am mdp (https://keybase.io/mdp) on keybase. | |
* I have a public key whose fingerprint is 3D13 2F63 3496 5AD3 5ECF 8001 8162 FA3B 5DE5 6C9A | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am mdp on github. | |
* I am mdp (https://keybase.io/mdp) on keybase. | |
* I have a public key whose fingerprint is 3D13 2F63 3496 5AD3 5ECF 8001 8162 FA3B 5DE5 6C9A | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function localTime(offset) { | |
var d = new Date(); | |
var utc = d.getTime() + (d.getTimezoneOffset() * 60000); | |
return new Date(utc + (3600000*offset)); | |
} | |
localTime(5.5); | |
localTime(-8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Luhn Class is an implementation of the Luhn algorithm that checks validity of a credit card number. | |
* | |
* @author <a href="http://www.chriswareham.demon.co.uk/software/Luhn.java">Chris Wareham</a> | |
* @version Checks whether a string of digits is a valid credit card number according to the Luhn algorithm. 1. Starting with the second to last digit and | |
* moving left, double the value of all the alternating digits. For any digits that thus become 10 or more, add their digits together. For example, | |
* 1111 becomes 2121, while 8763 becomes 7733 (from (1+6)7(1+2)3). 2. Add all these digits together. For example, 1111 becomes 2121, then 2+1+2+1 is | |
* 6; while 8763 becomes 7733, then 7+7+3+3 is 20. 3. If the total ends in 0 (put another way, if the total modulus 10 is 0), then the number is valid | |
* according to the Luhn formula, else it is not valid. So, 1111 is not valid (as shown above, it comes out to 6), while 8763 is valid (as shown | |
* above, it comes ou |