Skip to content

Instantly share code, notes, and snippets.

View levidurfee's full-sized avatar

Levi Durfee levidurfee

View GitHub Profile

Keybase proof

I hereby claim:

  • I am levidurfee on github.
  • I am ldurfee (https://keybase.io/ldurfee) on keybase.
  • I have a public key ASBY6qZh--demtGpauiVc3PtSY4Kya3rbc0QwfW5HNcUpAo

To claim this, I am signing this object:

@levidurfee
levidurfee / material-design-shadows.css
Created September 10, 2018 18:46 — forked from serg0x/material-design-shadows.css
Google material design elevation system shadows as css. Based on https://material.io/design/environment/elevation.html#default-elevations Exported with Sketchapp from the Google material design theme editor plugin "Baseline" theme.
.boxshadow-none { box-shadow: none; }
.boxshadow-1dp { box-shadow: 0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.20); }
.boxshadow-2dp { box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.20); }
.boxshadow-3dp { box-shadow: 0 3px 4px 0 rgba(0,0,0,0.14), 0 3px 3px -2px rgba(0,0,0,0.12), 0 1px 8px 0 rgba(0,0,0,0.20); }
.boxshadow-4dp { box-shadow: 0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.20); }
.boxshadow-6dp { box-shadow: 0 6px 10px 0 rgba(0,0,0,0.14), 0 1px 18px 0 rgba(0,0,0,0.12), 0 3px 5px -1px rgba(0,0,0,0.20); }
.boxshadow-8dp { box-shadow: 0 8px 10px 1px rgba(0,0,0,0.14), 0 3px 14px 2px rgba(0,0,0,0.12), 0 5px 5px -3px rgba(0,0,0,0.20); }
.boxshadow-9dp { box-shadow: 0 9px 12px 1px rgba(0,0,0,0.14), 0 3px 16px 2px rgba(0,0,0,0.12), 0 5px 6px -3px rgba(0,0,0,0.20); }
.boxshadow-12dp { box-shadow: 0 12px 17px 2px rgba(0,0,0,0.14), 0 5px 22px 4px rgba(0,0,0,0.12), 0 7px
@levidurfee
levidurfee / worker.js
Created May 25, 2018 21:05
Block countries in Europe using Cloudflare Workers
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
const countryCodes = [
'BE', 'BG', 'CZ', 'DK', 'DE', 'EE', 'IE', 'EL', 'ES', 'FR', 'HR', 'IT', 'CY', 'LV', 'LT', 'LU', 'HU', 'MT', 'NL',
'AT', 'PL', 'PT', 'RO', 'SI', 'SK', 'FI', 'SE', 'UK'
];
/**
@levidurfee
levidurfee / htaccess_1
Last active February 21, 2018 00:05
htaccess
allow from all
deny from 1.2.3.4 # blocks one IP address
deny from 1.3 # blocks every IP beginning with 1.3
<?php
function digitalOcean($DO_API_TOKEN) {
$endpoint = "https://api.digitalocean.com/v2/droplets?per_page=200";
$headers[] = "Content-type: application/json";
$headers[] = "Authorization: Bearer $DO_API_TOKEN";
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_HTTPHEADER => $headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $endpoint,
@levidurfee
levidurfee / upload.php
Last active August 29, 2018 18:25 — forked from taterbase/upload.php
Simple file upload in php
<?php
$message = '';
if(!empty($_FILES['uploaded_file'])) {
$path = 'uploads/';
$path = $path . uniqid('u', true) . '-' . basename($_FILES['uploaded_file']['name']);
if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {
$message = 'The file ' . basename( $_FILES['uploaded_file']['name']) . ' has been uploaded';
} else {
$message = 'There was an error uploading the file, please try again!';
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
input, button {display:block;margin-bottom:10px;}
</style>
</head>
@levidurfee
levidurfee / miner.c
Last active July 14, 2017 17:15
openmp
/*L****************************************************************************
* FILENAME: hash.c VERSION: 0.5.0
*
* DESCRIPTION: SHA512 Miner example
*
* AUTHOR: Levi Durfee DATE: 20170714
*
* CHANGES
* ----------------------------------------------------------------------------
* REF NO VERSION DATE WHO NOTES
@levidurfee
levidurfee / README.md
Last active July 11, 2017 22:55
Help me, please.
gcc hash.c -o hash -lcrypto -lssl -Wall
./hash
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
node_modules/
.env