This file contains 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
services: | |
chroma: | |
image: "chromadb/chroma:latest" | |
volumes: | |
- ./__data__/chromadb:/chroma/chroma | |
environment: | |
- IS_PERSISTENT=TRUE | |
- PERSIST_DIRECTORY=${PERSIST_DIRECTORY:-/chroma/chroma} | |
- ANONYMIZED_TELEMETRY=${ANONYMIZED_TELEMETRY:-TRUE} | |
ports: |
This file contains 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
app.factory("Pagination", | |
[ | |
'$filter', | |
function($filter){ | |
var Pagination = { | |
data: { | |
perPage:20, | |
count: 0, | |
currentPage: 0, | |
paginationSet: [], |
This file contains 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
JavascriptJukebox = { | |
letsGetThisPartyStarted: function(){ | |
Array.prototype.randomElement = function () { | |
return this[Math.floor(Math.random() * this.length)]; | |
}; | |
var lyrics = this.lyrics().randomElement(); | |
this.playItAgainTony(lyrics); | |
}, | |
playItAgainTony: function(lyrics){ | |
var i = 0; |
This file contains 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
/* | |
* Based off of Sails.js 0.11.1 Blueprints REST API generator | |
*/ | |
Blueprints = { | |
serializeObject: function(){ | |
//js function to create json object out of form data | |
$.fn.serializeObject = function(){ | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { |
This file contains 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 | |
//create our mega query with post data, meta fields, and taxonomies | |
function get_posts_terms_fields($params=null){ | |
global $wpdb; | |
$defaults=array( | |
'posts_per_page' => 5, | |
'offset' => 0, | |
'category' => '', | |
'category_name' => '', |
This file contains 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
#set variables | |
SET @oldurl = 'http://oldurl.com'; | |
SET @newurl = 'http://newurl.com'; | |
#update wp_site options | |
UPDATE wp_options SET option_value = replace(option_value, @oldurl, @newurl) WHERE option_name = 'home' OR option_name = 'siteurl'; | |
#update wp_posts guid | |
UPDATE wp_posts SET guid = REPLACE (guid, @oldurl, @newurl); |
This file contains 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
//Comment walker | |
function comments_walker($comment, $args, $depth) { | |
$GLOBALS['comment'] = $comment; | |
extract($args, EXTR_SKIP); | |
if ( 'div' == $args['style'] ) { | |
$tag = 'div'; | |
$add_below = 'comment'; | |
} else { | |
$tag = 'li'; |
This file contains 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
function cycle($first_value, $values = '*') { | |
static $count = array(); | |
$values = func_get_args(); | |
$name = 'default'; | |
$last_item = end($values); | |
if( substr($last_item, 0, 1) === ':' ) { | |
$name = substr($last_item, 1); | |
array_pop($values); | |
} | |
if( !isset($count[$name]) ) |
NewerOlder