Skip to content

Instantly share code, notes, and snippets.

View RazorSh4rk's full-sized avatar
🦈
hi

Razor RazorSh4rk

🦈
hi
  • USA
View GitHub Profile
@RazorSh4rk
RazorSh4rk / wp.sh
Created September 5, 2021 16:48
Set a random wallpaper from unsplash on xfce
#!/bin/bash
if [[ $1 == "" ]]; then
QUERY="neon"
else
QUERY=$1
fi
echo "► searching for $QUERY"
<html>
<head>
<style>
body {
margin: 0px;
padding: 0px;
}
.bg {
import play.api.libs.json._
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.Future
import scala.util.Success
import scala.util.Failure
import java.io.BufferedWriter
import java.io.FileWriter
import requests.auth
import com.redis._
@RazorSh4rk
RazorSh4rk / test.scala
Created February 14, 2020 12:55
scala speed test
import java.time.Instant
import java.time.Duration
import scala.util.Random
import scala.math.abs
import scala.math.pow
object Main extends App {
val LEN = 10_000
val r = new Random()
val l = List.tabulate(LEN)(el => r.between(-5000, 5000)).sorted
@RazorSh4rk
RazorSh4rk / hackerrank.ml
Created January 6, 2019 22:40
Hackerrank helper for OCaml
let rec read_lines () =
try let line = read_int () in
line :: read_lines ()
with
_ -> []
;;
let f ls =
(* write your code here *)
;;
@RazorSh4rk
RazorSh4rk / Email.java
Created December 16, 2018 10:43
Send an email with java without reading 100s of how-tos
package Control;
import java.util.Properties;
import javax.mail.Session;
import javax.mail.Message;
import javax.mail.Transport;
import javax.mail.Authenticator;
import javax.mail.MessagingException;
import javax.mail.internet.InternetAddress;
import javax.mail.PasswordAuthentication;
@RazorSh4rk
RazorSh4rk / ping.py
Created October 30, 2018 10:49
Python GUI server pinging app
import tkinter, os
window = tkinter.Tk()
def callbk():
_res = os.system('ping -c 1 ' + ent.get())
res.configure(text='success' if _res == 0 else 'fail')
lbl = tkinter.Label(window, text='IP: ')
ent = tkinter.Entry(window)
btn = tkinter.Button(window, text='ping', command=callbk)
res = tkinter.Label(window, text='...')
lbl.pack()