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 ( | |
"bytes" | |
"encoding/binary" | |
"encoding/hex" | |
"log" | |
"math/rand" | |
"strings" | |
"net" |
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
Sample ddclient.conf entries: | |
protocol=dyndns2 | |
use=web | |
server=domains.google.com | |
ssl=yes |
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 testGetUserAge(){ | |
// Mock the responses of the fetch to our API to return some fake data | |
when(fetch("https://myapi.com/users/123")).thenReturn({dateOfBirth:new Date("06/16/1993")} | |
when(fetch("https://myapi.com/users/456")).thenReturn({dateOfBirth:new Date("06/16/1994")} | |
// Assert that given the return value of the api, the function returns the correct value | |
expect(getUserAge(123, 456)).toEqual(1) | |
} |
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 getUserAgeDifference(user1, user2) { | |
var user1Info = fetch("https://myapi.com/users/" + user1) | |
var user2Info = fetch("https://myapi.com/users/" + user2) | |
var ageDifference = user2Info.dateOfBirth - user1Info.dateOfBirth | |
return ageDifference | |
} |
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
# If your internet is down, quickly find out when it comes back! | |
# "If you can't connect to Google, it's your fault" | |
set -x | |
while true; do | |
ping www.google.com | |
sleep 10 | |
done |
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 ( | |
"log" | |
"net/http" | |
) | |
func main() { | |
port := os.Getenv("PORT") |
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
from bs4 import BeautifulSoup | |
import urllib2 | |
import re | |
import time | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support import expected_conditions as EC | |
from time import gmtime, strftime |
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 | |
# Stop deleting this CISE admins. If there's an issue email me. | |
if [ ! -e "/tmp/steam_$USER/usr/lib/steam/steam.sh" ]; then | |
rm -rf "/tmp/steam_$USER" | |
mkdir -p "/tmp/steam_$USER" | |
cd "/tmp/steam_$USER" | |
wget 'https://steamcdn-a.akamaihd.net/client/installer/steam.deb' -O 'steam.deb' | |
dpkg-deb -R steam.deb . |
NewerOlder