Skip to content

Instantly share code, notes, and snippets.

View ryanlelek's full-sized avatar
🔮
Like Magic

Ryan Lelek ryanlelek

🔮
Like Magic
View GitHub Profile
@ryanlelek
ryanlelek / javascript_cdns.txt
Created August 28, 2014 06:58
JavaScript CDNs
//ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js
//code.jquery.com/jquery.min.js
//getbootstrap.com/dist/js/bootstrap.js
//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css
@ryanlelek
ryanlelek / benchmark.sh
Created December 2, 2014 15:22
Benchmark
#!/bin/bash
# Modified from http://www.shellhacks.com/en/Check-a-Website-Response-Time-from-the-Linux-Command-Line
curl -s -w '\nLookup:\t%{time_namelookup}\nConnect:\t%{time_connect}\nApp Connect:\t%{time_appconnect}\nRedirect:\t%{time_redirect}\nPretransfer:\t%{time_pretransfer}\nStarttransfer:\t%{time_starttransfer}\n\nTotal:\t%{time_total}\n' -o /dev/null {$1};
@ryanlelek
ryanlelek / cpu.js
Last active October 28, 2024 22:00 — forked from bag-man/cpu.js
var os = require("os");
//Create function to get CPU information
function cpuAverage() {
//Initialise sum of idle and time of cores and fetch CPU info
var totalIdle = 0, totalTick = 0;
var cpus = os.cpus();
//Loop through CPU cores
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
<?PHP
/**
* pingdom.php
*
* This application will check your server swap, hard drive, cpu, and MySQL conditions.
* It will then generate an appropriate XML file for a Pingdom HTTP Custom check.
*
* If any usage is above your preset thresholds, then a down message will be returned,
* indicating that your server may be under more load than usual, hopefully, providing
* a bit of advanced notice before a true failure due to lack of resources
@ryanlelek
ryanlelek / index.html
Created March 5, 2015 23:38
Bootstrap
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Starter Template for Bootstrap</title>
@ryanlelek
ryanlelek / haproxy.conf
Last active August 29, 2015 14:25 — forked from dsuch/haproxy.conf
# At most 10 concurrent connections from a client
acl too_fast fe_sess_rate ge 10
# Matches any path beginning with a given prefix
acl bursts_inclined path_beg -i /client1
# Effectively working as a delay mechanism for clients that are too fast
tcp-request inspect-delay 1000ms
# Fast-path - accept connection if it's not this troublesome client
/**
* Move in a circle without wrapper elements
* Idea by Aryeh Gregor, simplified by Lea Verou
*/
@keyframes rot {
from {
transform: rotate(0deg)
translate(-150px)
rotate(0deg);
@ryanlelek
ryanlelek / Vagrantfile
Created January 16, 2016 06:42 — forked from leifg/Vagrantfile
Add a second disk to system using vagrant
file_to_disk = './tmp/large_disk.vdi'
Vagrant::Config.run do |config|
config.vm.box = 'base'
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024]
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end
@ryanlelek
ryanlelek / template.j2
Created May 13, 2018 16:16
AnsibleTutorials Template Patch (Temp)
# Regular Variable
{{ regular_variable }}
# If / Else
{% if use_hyperdrive == false %}
Hyperdrive is not enabled
{% else %}
Hyperdrive is enabled!
{% endif %}