Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>hi world!</title>
</head>
<body>
<p>It is me, a gist iframe in AMP!</p>
</body>
</html>
@levidurfee
levidurfee / Greeter.ts
Last active April 25, 2017 00:06
Gist with multiple files, different languages, and more code
class Greeter {
greeting: string;
constructor(message: string) {
this.greeting = message;
}
greet() {
return "Hello, " + this.greeting;
}
}
@levidurfee
levidurfee / bubble.c
Last active April 10, 2017 01:28
bubbles!
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
void show_array(int numbers[], int size);
int main() {
int swap, i, large, small = 0;
int numbers[] = {
90,
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
node_modules/
.env
@levidurfee
levidurfee / README.md
Last active July 11, 2017 22:55
Help me, please.
gcc hash.c -o hash -lcrypto -lssl -Wall
./hash
@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
<!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 / 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!';
<?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 / 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