Skip to content

Instantly share code, notes, and snippets.

View DeviaVir's full-sized avatar
🏴‍☠️

Chase DeviaVir

🏴‍☠️
View GitHub Profile
@DeviaVir
DeviaVir / latlondistance.sql
Created December 5, 2013 15:20
Calculating distance between two points (Latitude, Longitude). Author: https://coderwall.com/st0ik
$lat = 41.118491 // Users latitude
$lng = 25.404509 // Users longitude
SELECT *,
( 6371 * acos( cos( radians($lat) )
* cos( radians( latitude ) )
* cos( radians( longitude ) - radians($lng) ) + sin( radians($lat) )
* sin( radians( latitude ) ) ) )
AS calculated_distance
FROM settings as T
.parallax-image {
background: url() repeat center center fixed;
background-clip: padding-box;
}
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_objects import RGBColor
import argparse
import math
@DeviaVir
DeviaVir / wp.conf
Created March 4, 2014 11:23
Wordpress nginx config
location / {
if (!-e $request_filename) {
rewrite ^(.+)$ / last;
break;
}
}
@DeviaVir
DeviaVir / dd-infra-history.md
Last active August 29, 2015 14:08
DualDev Infrastructure History

DualDev

Below you will find an overview of all changes made to the DualDev infrastructure since founding the company back in 2010. We hope this document clears up many of the technical and executive choices we've had to make in the past. News is noted from newest to oldest date.

2014

November - continuing development The move to AWS has been completed to a phase where we don't have to keep monitoring the platform 24/7, and where we can finally start trusting the platform again. We still have to move several services (including loadbalancers, DNS and other things), but we've continued development of a renewed website, face and customer panel. The service we offer, will be again fast, stable and futuristic, as you're used to from us, soon. Before we continue on building the new website, we still have two of the old servers in service for loadbalancing, backups and e-mail services. These will be retired the 28th of november (at night). The loadbalancing and backups have been moved. E-mail will also

@DeviaVir
DeviaVir / nginx
Created November 7, 2014 11:16
/etc/logrotate.d/nginx
/var/log/nginx/*/*.log {
create 0644 nginx nginx
daily
rotate 10
missingok
notifempty
compress
sharedscripts
postrotate
/etc/init.d/nginx reopen_logs
@DeviaVir
DeviaVir / youtube-categories.json
Created November 19, 2014 11:13
All YouTube Categories
{
"kind": "youtube#videoCategoryListResponse",
"etag": "\"yHwg34KvgIlW9-uBcSEkgasDbzI/7bU1D6PRprGz-kkVw8F263q0FD8\"",
"items": [
{
"kind": "youtube#videoCategory",
"etag": "\"yHwg34KvgIlW9-uBcSEkgasDbzI/Xy1mB4_yLrHy_BmKmPBggty2mZQ\"",
"id": "1",
"snippet": {
"channelId": "UCBR8-60-B28hp2BmDPdntcQ",
@DeviaVir
DeviaVir / dabblet.css
Created January 5, 2015 11:17 — forked from LeaVerou/dabblet.css
The cicada principle in animations
/**
* The cicada principle in animations
* Remember the cicada principle that used prime numbers to make multiple overlaid repeated backgrounds seem more random?
* There’s no reason it can’t be applied to repeating linear animations too (using primes for the durations, divided by 10)
*/
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes radius { 50% { border-radius: 50%; } }
@keyframes color { 50% { color: orange; } }
@keyframes width { 50% { border-width: .3em; } }
@DeviaVir
DeviaVir / nginx.conf
Last active August 29, 2015 14:12
Subdomain rewrite
location /wp {
if (!-e $request_filename) {
rewrite ^(.*)$ /wp/index.php?/$1 last;
break;
}
}
@DeviaVir
DeviaVir / ips.txt
Created January 7, 2015 17:13
CryptoPHP Control Node IP addresses
192.42.116.41/32
209.99.40.219/32
78.138.118.195/32
78.138.118.196/30
78.138.118.200/29
78.138.118.208/31
209.99.40.220/30
87.119.222.112/32
87.119.222.108/30
87.119.222.112/29