start new:
tmux
start new with session name:
tmux new -s myname
setenv SSH_ENV $HOME/.ssh/environment | |
if [ -n "$SSH_AGENT_PID" ] | |
ps -ef | grep $SSH_AGENT_PID | grep ssh-agent > /dev/null | |
if [ $status -eq 0 ] | |
test_identities | |
end | |
else | |
if [ -f $SSH_ENV ] | |
. $SSH_ENV > /dev/null |
<?xml version='1.0'?> | |
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> | |
<!-- | |
1. Download the Symbola font: | |
http://users.teilar.gr/~g1951d/Symbola707.zip | |
2. unzip the file and put Symbola.ttf (and any of the other fonts that strike your fancy) | |
in your ~/.fonts/ directory | |
3. run `fc-cache -f`. You can check to make sure the new fonts |
This is a quick guide to Kotlin programming language. The previous part of this guide is here
#Object Oriented
fun main(args : Array<String>) {
class local (val x : Int)
val y = local(10)
println("${y.x}")
#Intro
Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3
Kotlin project website is at kotlin.jetbrains.org.
All the codes here can be copied and run on Kotlin online editor.
Let's get started.
#this script can never fail | |
#i use it in the fish_config | |
#call it with start_agent | |
setenv SSH_ENV $HOME/.ssh/environment | |
function start_agent | |
if [ -n "$SSH_AGENT_PID" ] | |
ps -ef | grep $SSH_AGENT_PID | grep ssh-agent > /dev/null |
I moved this page to rakudo wiki. A lot of people wanted to add stuff, but gists are not editable. A wiki is a more appropriate place for this kind of stuff. Rakudo wiki is possibly not the best place for it, but for now that will do.
Plus, GitHub gists totally suck when unicode characters are involved. There's also no preview option here. So I'm glad that it is being moved.
Recently Perl 6 got support for various unicode characters (½ ¹ ∞ × ÷, see this link for a full list), but I don't think that we are done. Here is a list of things to think about.
#!/usr/bin/env perl6 | |
use v6.c; | |
sub MAIN(Str $module) { | |
my $cu = $*REPO.need(CompUnit::DependencySpecification.new(:short-name($module))); | |
say "Dist: " ~ $cu.repo.prefix.child('dist/' ~ $cu.distribution.id); | |
say "Source: " ~ $cu.repo.prefix.child('sources/' ~ $cu.distribution.provides{$module}.values[0]<file>); | |
} |
our sub MAIN_HELPER($retval = 0) is export { | |
say "doing getopty stuff!"; | |
my $m = callframe(1).my<&MAIN>; | |
return $retval unless $m; | |
say 'calling MAIN with no args'; | |
$m(); | |
} |
Is there a cute Perl 6 way to take an array (say
‘a’..‘d’
) and get all head/tail partitions of it (e.g.(<a>, <b c d>), (<a b>, <c d>), (<a b c>, <d>))
?
Sure! Pick one:
my @a = ‘a’..‘e’; say (@a[^$_, $_..*] for 1..^@a);
my @b = ‘a’..‘e’; say (1..^@b).map: {@b[^$_, $_..*]};
my @c = ‘a’..‘e’; say (@c.rotor($_, ∞, :partial) for 1..^@c);
my @z = ‘a’..‘e’; say @z[0..*-2].keys.map: {@z[0..$_, $_^..*]}; # same as b
my @d = ‘a’..‘e’; say (1..^@d).map: {@d.rotor: $_, ∞, :partial};