If you haven't already got a ~/.ssh/id_rsa.pub on your computer, you'll need to generate one.
To generate key
ssh-keygen
To copy ssh key to your clipboard on a mac:
function xhr(method, uri, body, handler) { | |
var req = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); | |
req.onreadystatechange = function () | |
{ | |
if (req.readyState == 4 && handler) | |
{ | |
eval('var o=' + req.responseText); | |
handler(o); | |
} | |
} |
<?php | |
$userMail = '[email protected]'; | |
$imageWidth = '150'; //The image size | |
$imgUrl = 'http://www.gravatar.com/avatar/'.md5($userMail).'fs='.$imageWidth; | |
echo "<img src=\"$imgUrl\">"; | |
?> |
<?php | |
// Converts a number into a short version, eg: 1000 -> 1k | |
// Based on: http://stackoverflow.com/a/4371114 | |
function number_format_short( $n, $precision = 1 ) { | |
if ($n < 900) { | |
// 0 - 900 | |
$n_format = number_format($n, $precision); | |
$suffix = ''; | |
} else if ($n < 900000) { |
import android.os.CountDownTimer | |
abstract class CountUpTimer protected constructor(private val duration: Long) : | |
CountDownTimer(duration, INTERVAL_MS) { | |
abstract fun onTick(second: Int) | |
override fun onTick(msUntilFinished: Long) { | |
val second = ((duration - msUntilFinished) / 1000).toInt() | |
onTick(second) | |
} |
private fun stopCountDown(){ | |
val t = Toast.makeText(this,"Stopping countdown",Toast.LENGTH_SHORT).show() | |
timer1.cancel() | |
timer1IsRunning=false | |
} | |
private fun startCountDown(){ | |
timer1 = object : CountDownTimer(duration, interval) { | |
override fun onFinish() { | |
txtTimer1.text = "0" |
btnStartInfiniteTimer.setOnClickListener{ | |
if (!isInfiniteTimerRunning){ | |
infiniteTimer=Timer() | |
isInfiniteTimerRunning = true | |
infiniteTimer.scheduleAtFixedRate(object : TimerTask() { | |
override fun run() { | |
infiniteTimerTick() | |
} | |
}, 0, 1000) | |
} |
defaults write com.apple.finder CreateDesktop false | |
killall Finder |
[ | |
{ | |
"id": "1", | |
"name": "John", | |
"email": "[email protected]", | |
"location": "Mexico" | |
}, | |
{ | |
"id": "2", | |
"name": "Peter", |