Skip to content

Instantly share code, notes, and snippets.

@sobytes
sobytes / custom-search-acf-wordpress.php
Created November 27, 2015 12:54 — forked from charleslouis/custom-search-acf-wordpress.php
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
@sobytes
sobytes / gist:e9acd8c13943f8d635e2
Last active September 14, 2015 18:21 — forked from Skoua/gist:5927652
Add route to an Apple Map using Google Maps Directions API in Titanium (Alloy).
// setup geolocation purpose and accuracy
Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_BEST;
Ti.Geolocation.purpose = L('geo-purpose');
// setup map and poi's annotation
var latitude = 48.847684,
longitude = 2.35165;
var annotation = Titanium.Map.createAnnotation({
animate: true,
@sobytes
sobytes / CROP.md
Last active August 29, 2015 14:27 — forked from FokkeZB/CROP.md
Image (cropping) CommonJS lib for Titanium

Often I need to display a user-provided picture in an ImageView in such a way that the whole ImageView is filled with as much of the picture possible.

This is how I do it:

var image = require('image');

Ti.Media.showCamera({
        mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
 success: function (e) {
@sobytes
sobytes / .htaccess
Last active August 29, 2015 14:25
CI: Simple .htaccess using mod_rewrite for CodeIgniter
<IfModule mod_rewrite.c>
RewriteEngine On
# !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
# slashes.
# If your page resides at
# http://www.example.com/mypage/test1
# then use
# RewriteBase /mypage/test1/
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
@sobytes
sobytes / app.js
Last active August 29, 2015 14:17 — forked from codeboxed/app.js
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
var isAndroid = false;
if (Ti.Platform.name === 'android') {
isAndroid = true;
}
// create tab group
{
"Version": "2016-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":[
"s3:*"
],
"Resource":[
"arn:aws:s3:::bucket",
@sobytes
sobytes / gist:bef0c4de602e703680f9
Last active August 29, 2015 14:15
Home page slider custom post type
/**
* Home page slider function to create a main slider
*
* @return void
* @author Sam East
*/
function home_slider_post_type() {
$labels = array(
'name' => _x( 'Home Slider', 'post type general name' ),
'singular_name' => _x( 'Home Slider', 'post type singular name' ),