Skip to content

Instantly share code, notes, and snippets.

View WDC's full-sized avatar

David M. Lemcoe Jr. WDC

View GitHub Profile
@WDC
WDC / nginx-centos7.yml
Last active December 12, 2019 20:17 — forked from icasimpan/nginx-centos7.yml
Sample ansible playbook to install nginx with sample page on CentOS7
## Credits to John Lieske - https://www.ansible.com/blog/getting-started-writing-your-first-playbook
---
- name: Install nginx
hosts: all
become: true
tasks:
- name: Add epel-release repo
yum:
name: epel-release
@WDC
WDC / gist:4056851
Created November 12, 2012 00:13
Croomy_auth .gitignore file
.gitignore
application/.htaccess
application/cache/.htaccess
application/cache/index.html
application/config/autoload.php
application/config/config.php
application/config/constants.php
application/config/database.php
application/config/doctypes.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Website details
|
| These details are used in emails sent by authentication library.
|--------------------------------------------------------------------------
*/
$config['website_name'] = 'Instapitch';
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="https://raw.github.com/HPNeo/gmaps/master/gmaps.js"></script>
</head>
<body>
<div id="map2"></div>
</body>
[root@vpsgrid david]# npm ls
npm WARN package.json david@0.0.1 No README.md file found!
david@0.0.1 /root/david
├─┬ express@3.0.1
│ ├── commander@0.6.1
│ ├─┬ connect@2.6.2
│ │ ├── bytes@0.1.0
│ │ ├── formidable@1.0.11
│ │ ├── pause@0.0.1
│ │ └── qs@0.5.1
[root@localhost app]# php index.php
| PHP Int to String and Back |0.012935062068966 |
| Ruby Int to String and Back |0.055767344827586 |
| Python Int to String and Back |0.090967367435324 |
| Node.js Int to String and Back |0.01944035497205 |
| PHP Int to String and Concat |0.014449668965517 |
| Ruby Int to String and Concat |0.061579172413793 |
| Python Int to String and Concat |0.047807578382814 |
| PHP Sequential Array Average |0.001556175862069 |
| Ruby Sequential Array Average |0.021841517241379 |
$ch = curl_init("https://graph.facebook.com/1253601124/picture?type=large");
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$header = "Location: ";
$pos = strpos($response, $header);
from collections import Counter
def median(aray):
srtd = sorted(aray)
alen = len(srtd)
return 0.5*( srtd[(alen-1)//2] + srtd[alen//2])
numbers = (1,2,3,4,5,6,7,8,9,10,10,10,11,12)
from array import *
mean = 0
for i in numbers:
@WDC
WDC / gist:3728671
Created September 15, 2012 16:25
jQuery Add Rows to Table
$(document).ready(function(){
$("#add").click(function(){
$('#table').append("<tr><td>hello</td><td>world</td><td><input type='button' id='del' value='del' /></td></tr>");
});
$('#table').delegate('tr', 'click', function(event) {
$(this).remove();
});
});