// Custom Admin styles + JS
add_action('admin_enqueue_scripts', function($hook){
wp_enqueue_style('fb_wp_admin_css', Assets\asset_path('styles/admin.css'));
wp_enqueue_script('fb_wp_admin_js', Assets\asset_path('scripts/admin.js'), ['jquery'], null, true);
}, 100);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Pull all files in a directory into an array | |
$comic_dir = $_GET['comic']; // something like '001' | |
$files_in_dir = dirList("/archive/$comic_dir/",'\d+\.\w{3}'); // assumes files are named 5.jpg, can adjust regex if you have other files in dir you don't want to output (like a cover image) | |
function pageJumpLinks($num_pages) { | |
$output = ''; | |
for ($i=0; $i < $num_pages; $i++) { | |
$output .= '<a href="#' . $i . '">' . $i . '</a> | '; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'CSV' | |
output = '' | |
# get areas | |
areas = {} | |
CSV.foreach("community-areas.csv", headers:true) do |row| | |
areas[row['shapeid']] = row['community'] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'json' | |
output = '' | |
file = File.read('niagarazips.json') | |
city = 'NiagaraFalls' | |
# file = File.read('nczips.json') | |
# city = 'NashEdgecombe' | |
# file = File.read('nyzips.json') | |
# city = 'NewYork' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require('express')(); | |
var server = require('http').Server(app); | |
var io = require('socket.io')(server); | |
var redis = require('redis').createClient({host: 'localhost'}); | |
var port = process.env.PORT || 8890; | |
server.listen(port); | |
io.on('connection', function (socket) { | |
socket.on('subscribe', function(data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'date' | |
logtext = "Account Deactivated : Wednesday, August 8, 2012 at 8:52pm CDT | |
Account Reactivated : Sunday, November 4, 2012 at 3:14pm CST | |
Account Deactivated : Sunday, November 4, 2012 at 3:25pm CST | |
Account Reactivated : Monday, December 24, 2012 at 9:42pm CST | |
Account Deactivated : Monday, December 24, 2012 at 10:02pm CST | |
Account Reactivated : Thursday, January 10, 2013 at 9:07am CST | |
Account Deactivated : Thursday, January 10, 2013 at 9:14am CST |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER=username | |
PROJECT=projectname | |
SERVER=siteurl.com | |
rsync --delete -rvzce ssh . ${USER}@${SERVER}:webapps/${PROJECT}/ \ | |
--exclude /.git \ | |
--exclude /assets \ | |
--exclude /tmp \ | |
--exclude /cache \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Pulls git log entries for a day formatted for pasting in a timesheet | |
# Usage: | |
# gitlog = all commits today | |
# gitlog -2 = all commits -2 days ago | |
# gitlog 2024-10-03 or 10/3/2024 or 10-3 | |
args=$1 | |
# Replace / with - in args for alternate date formats e.g. 10/3/2024 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Creator: Phil Cook | |
# Email: [email protected] | |
# Twitter: @p_cook | |
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g') | |
brew_array=("5.6","7.0","7.1","7.2","7.3") | |
php_array=("[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]") | |
valet_support_php_version_array=("[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]") | |
php_installed_array=() |
OlderNewer