# Creating a lambda
l = lambda { |name| "Hi #{name}!" }
# Executing the lambda
l.call("foo") # => Hi foo!
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 | |
# get rid of duplicate apps by reindexing | |
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user | |
# reindex mail | |
#rm "$HOME/Library/Mail/v2/MailData/Envelope Index" | |
#rm "$HOME/Library/Mail/v2/MailData/Envelope Index-shm" | |
#rm "$HOME/Library/Mail/v2/MailData/Envelope Index-wal" |
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
gdisk /dev/sda # make 1 partition | |
mkfs.vfat -n BOOT /dev/sda1 | |
mkfs.btrfs -L root /dev/sdb | |
mkfs.btrfs -L docker /dev/sdc | |
mount -t btrfs -o noatime,discard,ssd,autodefrag,compress=lzo,space_cache /dev/sdb /mnt/ | |
btrfs subvolume create /mnt/nixos | |
umount /mnt/ | |
mount -t btrfs -o noatime,discard,ssd,autodefrag,compress=lzo,space_cache,subvol=nixos /dev/sdb /mnt/ |
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
// What does this program output? | |
class S { | |
static final int I = 7; | |
static { | |
System.out.println("S"); | |
} | |
} |
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
// What is the output of this program? | |
// a) x = 2 | |
// b) x = 3 | |
// c) compile-error | |
// d) runtime exception | |
// e) something else _____ | |
abstract class Eggs { | |
abstract void m(); | |
Eggs() { |
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
#To Decrypt Jenkins Password from credentials.xml | |
#<username>jenkins</username> | |
#<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase> | |
#go to the jenkins url | |
http://jenkins-host/script | |
#In the console paste the script | |
hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J' |