I hereby claim:
- I am glennreilly on github.
- I am glennreilly (https://keybase.io/glennreilly) on keybase.
- I have a public key ASB5CKumFBuyaxsQPfarNSf-iDtGt9C_uCn30TOJy4w5Xwo
To claim this, I am signing this object:
#!/bin/sh | |
#Check the Drive Space Used by Cached Files | |
du -sh /var/cache/apt/archives | |
#Clean all the log file | |
#for logs in `find /var/log -type f`; do > $logs; done | |
logs=`find /var/log -type f` | |
for i in $logs |
I hereby claim:
To claim this, I am signing this object:
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
import javax.sound.midi.*; | |
public class Metronome implements MetaEventListener { | |
private Sequencer sequencer; | |
private int bpm; | |
public void start(int bpm) { | |
try { |
fun isAscending(list: List<Int>):Boolean { | |
return list.let { | |
var tempResult = true | |
it.forEachIndexed { idx, item -> | |
tempResult = if (idx != it.lastIndex) item < it[idx + 1] else true | |
if (!tempResult) return@let tempResult | |
} | |
tempResult | |
} | |
} |
All these functions are used for switching the scope of the current function / the variable. They are used to keep things that belong together in one place (mostly initializations). | |
Here are some examples: | |
run - returns anything you want and re-scopes the variable it's used on to this | |
val password: Password = PasswordGenerator().run { | |
seed = "someString" | |
hash = {s -> someHash(s)} | |
hashRepetitions = 1000 |
This came about thanks to Mark on the Renoise forum. Thanks for finally pointing me in the right direction for this.
http://forum.renoise.com/index.php?/topic/38738-renoise-linux-and-pulseaudio/
import java.time.Duration | |
import java.time.LocalDateTime | |
import java.time.Month | |
import java.time.Period | |
import java.time.temporal.TemporalUnit | |
import java.util.* | |
import javax.xml.datatype.DatatypeConstants.MINUTES | |
val startDate: LocalDateTime = LocalDateTime.of(2017,Month.NOVEMBER,25,16,30) | |
val endDate: LocalDateTime = LocalDateTime.now() |
import io.reactivex.Observable | |
import io.reactivex.ObservableEmitter | |
import io.reactivex.disposables.Disposable | |
import io.reactivex.functions.BiFunction | |
import io.reactivex.observables.GroupedObservable | |
import io.reactivex.schedulers.Schedulers | |
import java.util.* | |
import java.util.concurrent.TimeUnit | |
https://coderwall.com/p/euwpig/a-better-git-log | |
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
git lg |
eXtreme Go Horse (XGH) Process | |
Source: http://gohorseprocess.wordpress.com | |
1. I think therefore it's not XGH. | |
In XGH you don't think, you do the first thing that comes to your mind. There's not a second option as the first one is faster. | |
2. There are 3 ways of solving a problem: the right way, the wrong way and the XGH way which is exactly like the first one but faster. | |
XGH is faster than any development process you know (see Axiom 14). |