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
putStrLn | |
putStr | |
putChar | |
getChar | |
sequence | |
mapM | |
mapM_ |
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
Show hidden characters
{ | |
"compileOnSave": true, | |
"compilerOptions": { | |
"target": "es6", | |
"module": "commonjs", | |
"noImplicitAny": true, | |
"removeComments": true, | |
"preserveConstEnums": true, | |
"sourceMap": true, | |
"outDir": "compiled", |
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
char firstCh, secondCh; | |
printf("Enter first character: "); | |
scanf(" %c", &firstCh); // Note: a space before %c | |
printf("Enter second character: "); | |
scanf(" %c", &secondCh); | |
// The following WON'T work as the newline entered as part of the first scanf would be consumed by the next scanf call: | |
printf("Enter first character: "); | |
scanf("%c", &firstCh); // Will not work correctly! |
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
import java.time.Duration; | |
import java.time.temporal.ChronoUnit; | |
import java.util.concurrent.CompletableFuture; | |
import static java.lang.System.err; | |
import static java.lang.System.out; | |
public class HelloCompletableFuturesWithFailures { | |
public static void main(String[] args) { | |
CompletableFuture<String> future = new Async().thinkOfSomething(); |
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
import java.time.Duration; | |
import java.time.temporal.ChronoUnit; | |
import java.util.concurrent.CompletableFuture; | |
import static java.lang.System.err; | |
import static java.lang.System.out; | |
public class HelloCompletableFutures { | |
public static void main(String[] args) { | |
CompletableFuture<String> future = new Async().thinkOfSomething(); |
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
npm link |
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
readlink /Users/psingh/.node/bin/snippet |
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
% cd /usr/local/Cellar/postgresql/9.4.5_2/bin | |
% ./createdb --owner db_user --encoding utf8 db_name |
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
% cd /usr/local/Cellar/postgresql/9.4.5_2/bin | |
# -d user can create databases | |
# -P prompt for user password | |
# -E encrypt user's password | |
% createuser -d -P -E db_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
function sleep(milliSeconds) { | |
var startTime = new Date().getTime(); | |
while (new Date().getTime() < startTime + milliSeconds); | |
} | |
sleep(10000); |