Skip to content

Instantly share code, notes, and snippets.

@cdolek
cdolek / female.json
Created May 11, 2016 20:42
Mock User Data - 300 Male + 300 Female with IDS
[{"ID":"KAPH-2850-SVGO-4049","name":"Alexandra","familyName":"Heroux","gender":"F","birthDate":"1982-11-29T08:14:47Z"},
{"ID":"GKCB-5524-ADUB-5290","name":"Julianna","familyName":"Jacoby","gender":"F","birthDate":"1984-09-08T15:46:48Z"},
{"ID":"FKRC-2692-GJNY-6792","name":"Shoshana","familyName":"Juel","gender":"F","birthDate":"1975-07-15T10:08:39Z"},
{"ID":"CGIM-0373-DWNU-4445","name":"Ivey","familyName":"Stainbrook","gender":"F","birthDate":"1996-02-13T16:54:53Z"},
{"ID":"IOPV-9298-MZHB-9361","name":"Mariko","familyName":"Fishburn","gender":"F","birthDate":"1973-10-17T23:35:53Z"},
{"ID":"GPES-8736-WGKT-5994","name":"Le","familyName":"Broadway","gender":"F","birthDate":"1971-01-02T17:04:05Z"},
{"ID":"LPDB-2346-JWOH-6291","name":"Era","familyName":"Graybill","gender":"F","birthDate":"1988-11-09T11:16:07Z"},
{"ID":"LUHV-4847-MLGA-1906","name":"Aleen","familyName":"Abrahams","gender":"F","birthDate":"1994-06-12T08:43:37Z"},
{"ID":"LOXJ-0459-NYRP-1889","name":"Merri","familyName":"Masterson","gender":"F","birthD
@cdolek
cdolek / gist:71fecaa252a5672c923e
Created October 19, 2015 03:40
Google Spreadsheet Script
function findDateFromCalendarByName( find , timer ){
if ( find == '' ) { return; }
var ss = SpreadsheetApp.getActiveSpreadsheet(), output = [];
// var searchData = ss.getSheetByName('Calendar').getDataRange().getValues();
var searchData = ss.getSheetByName('Calendar').getRange("A1:P10").getValues();
for(var j=0, jLen=searchData.length; j<jLen; j++) {
@cdolek
cdolek / ddos
Created July 14, 2015 03:42
DDOS check
netstat -anp | grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
@cdolek
cdolek / gist:631e0e32c359efece02f
Last active August 29, 2015 14:24
speedtest from terminal
# via http://binarynature.blogspot.com/2013/03/measure-internet-connection-speed-from-linux-command-line.html
wget -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py && chmod +x speedtest-cli && ./speedtest-cli
@cdolek
cdolek / gist:d9a795b0eeaf03c62bb4
Last active August 29, 2015 14:23
fix broken homebrew
# PROBLEM ****************************************************************************
error: Your local changes to the following files would be overwritten by merge:
Library/Formula/node.rb
Please, commit your changes or stash them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
######################################################################################
# FIX BELOW -------------------------
cd $(brew --repository)
@cdolek
cdolek / example.com.conf
Last active November 15, 2019 00:25
nginx config example for memcached, php fpm and wordpress
http {
# memcached servers, generated according to wp-ffpc config
upstream memcached-servers {
server 127.0.0.1:11211;
}
# PHP-FPM upstream; change it accordingly to your local config!
upstream php-fpm {
@cdolek
cdolek / SanFrancisco.Neighborhoods.json
Last active January 21, 2025 10:32
San Francisco Neighborhoods GeoJson with Zipcodes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cdolek
cdolek / gist:f8952920e53b3cf6ac57
Created March 10, 2015 22:59
wordpress set proper file and folder permissions
# find all files forward this directory and set 644
sudo find . -type f -exec chmod 644 {} +
# find all directories forward and set 755
sudo find . -type d -exec chmod 755 {} +
@cdolek
cdolek / innodb_to_myisam.sql
Last active August 29, 2015 14:16
convert innodb to myisam - alter table print
SELECT
CONCAT(
'ALTER TABLE ',
TABLE_SCHEMA,
'.',
TABLE_NAME,
' ENGINE = MyISAM;'
)
FROM
information_schema. TABLES
@cdolek
cdolek / gist:372fc6421feffcd39860
Last active March 11, 2020 19:26
Utility for wordpress: Find missing attachment files, non writable upload directories and meta errors
<?php
/**
* Template Name: Attachment Fixing Utility
*/
?>
<html>
<head>
<title>Wordpress Attachments Fixing Utility</title>
<style>