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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/gorilla/mux" | |
"io/ioutil" | |
"net/http" | |
"strings" | |
) |
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
package main | |
import ( | |
// "encoding/json" | |
"fmt" | |
"github.com/gorilla/mux" | |
"io/ioutil" | |
"net/http" | |
// "strings" | |
"strings" |
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/sh | |
# Something here | |
date >> /var/log/boot-timestamps | |
echo "hello world" >> /home/root/hello-world.txt |
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
-- this Haskell version is not quite the same as the Nim and Racket versions since I am pulling in a Random | |
-- number to be guessed, rather than hardcoding the number as seen on Nim and Racket versions on line 3. I am also | |
-- adding comments to the functions in this Haskell version. This might prompt me to go through and revamp other | |
-- solutions in the future. | |
import System.Random | |
import System.Environment | |
import Text.Regex | |
import Text.Regex.Base |
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
-- firsthalf returns True if value is found in the first half of list ls | |
firsthalf value ls = elem val (reverse (drop (quot (length ls) 2) (reverse ls))) | |
-- subsek returns a subsection of list ls from start to end | |
subsek start end ls = drop start (reverse (drop (length ls - end) (reverse ls))) |
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
package main | |
import ( | |
"crypto/sha256" | |
"encoding/hex" | |
"fmt" | |
"os" | |
) | |
func main() { |
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
use std::env; | |
use std::fs; | |
use std::process; | |
fn main() { | |
let creds_file = match env::var("AWS_CREDS_FILE") { | |
Ok(val) => val, | |
Err(_) => { | |
println!("an env variable of AWS_CREDS_FIlE is required"); | |
process::exit(1); |