Skip to content

Instantly share code, notes, and snippets.

View solocommand's full-sized avatar

Josh Worden solocommand

  • Parameter1
  • Madison, WI
  • 05:42 (UTC -05:00)
View GitHub Profile
@solocommand
solocommand / models_contracts.js
Created November 24, 2014 15:04
Ember CLI Namespacing
// models/contracts.js
import Ember from 'ember';
var Contracts = Ember.Namepsace.extend({});
export default Contracts;
@solocommand
solocommand / store.js
Created November 26, 2014 15:38
ember store.js
// app/store.js
import DS from 'ember-data';
export default DS.Store.extend({
init: function() {
console.log('Using custom store!');
// console.log(this);
return this._super.apply(this, arguments);
},
#!/bin/bash
#
#Stage/Live MongoDB Dump & Population Script
#Version 0.2 10/22/2012
#Written by Adam Whitlock
### Variables ###
#mongodump variables
DBNAME="merrick"
@solocommand
solocommand / drupalExport.php
Last active August 29, 2015 14:17
Drush script for exporting MNI
<?php
ini_set('memory_limit', -1);
set_time_limit(0);
/**
*
*/
class Export {
@solocommand
solocommand / moveImages.sh
Created March 24, 2015 19:15
Moves images to new names
#!/bin/bash
limit=5000
counter=0
while [ $counter -lt $limit ]; do
image=$(head -n 1 images.txt)
echo "$(tail -n +2 images.txt)" > images.txt
@solocommand
solocommand / fix_endings.sh
Last active March 7, 2018 14:24 — forked from Jlaird/move_images.sh
move images scripts
#!/bin/bash
# Usage: ./fix_endings.sh fileName
# Example: ./fix_endings.sh nfn.1.csv
file=$1
limit=$(wc -l < "$file")
counter=1
# set -x
@solocommand
solocommand / calendar.php
Created April 13, 2015 17:31
kofc calendar
<?php
// Print out site header information
echo '<html><head><title>Knights of Columbus Calendar</title><link rel="stylesheet" type="text/css" href="kofccalendar.css"></head><body>';
$cy = isset($_GET['cy']) ? (int) $_GET['cy'] : 0; // See if year is defined ( view month other than current)
$cm = isset($_GET['cm']) ? (int) $_GET['cm'] : 0; // See if month is defined ( view month other than current)
if($cy == 0) { $cy = date('Y'); }
<?php
// ..
$start = time();
$jobs = array('processed' => array());
// For one minute, iterate over available jobs and run them.
while (time() > $start + 60) {
$query = sprintf('SELECT * FROM job WHERE status = 1 AND priority = "%s" AND (type = "onetime" OR (type = "reoccuring" AND (start is null OR NOW() >= start) AND (stop is null or NOW() < stop) AND NOW() >= DATE_ADD(last_started, INTERVAL `interval` MINUTE))) LIMIT 1;', (int) $priority);
fbl($query);
#!/bin/bash
#
# Usage: ./cpimages.sh oldPath newPath
# Example: ./cpimages.sh /data/media/files/cygnus/KBDN/image /data/media/files/base/sola/kbdn/image
#
mediaPath=$1
newPath=$2
#set -x
cd $mediaPath
@solocommand
solocommand / ScriptHandler.php
Created August 11, 2015 03:04
Old CoreBundle logic
<?php
namespace Cygnus\BaseBundle\Composer;
use Composer\Script\Event;
use Sensio\Bundle\GeneratorBundle\Manipulator\KernelManipulator;
class ScriptHandler
{