Skip to content

Instantly share code, notes, and snippets.

View marpstar's full-sized avatar

Cody Sand marpstar

View GitHub Profile
@marpstar
marpstar / gist:9274899
Created February 28, 2014 17:00
Embed Test
ff
{
"font_size": 11,
"ignored_packages":
[
"Markdown",
"Vintage"
],
"remember_open_files": false,
"caret_style": "smooth",
"highlight_line": true,
@marpstar
marpstar / WordPress - Limit search result to certain post types
Created August 4, 2014 22:41
Limit WordPress search results to certain post types.
/* limit search to pages only - works as of WordPress 3.9.1 */
function mySearchFilter($query) {
if ($query->is_search) {
$query->set('post_type', array('page', 'tribe-events'));
};
return $query;
};
add_filter('pre_get_posts','mySearchFilter');
@marpstar
marpstar / ngForce-visualForceRemoting.js
Created December 1, 2014 19:44
This allows me to call send() appropriately.
/*
* ngForce - a visualForce remoting based Angular.js service for developing
* Angular apps within Visualforce.
*
* Copyright (c)2013, Kevin Pooorman.
* License: MIT
*
* Vfr provides access to visualforce Remoting methods from any given class
* in the Org that are @remoteAction annotated.
*
query: send.call(this, 'ngForceController.query', {
escape: false,
timeout: 30000
}, false);
},
/*
send.call(...) will execute the send function and
"returns a function that, when called, invokes the js remoting method specified in the call."
$get: function($q, $rootScope) {
function send(remoteAction, options, nullok) {
var namespace, controller, method;
var Manager = Visualforce.remoting.Manager;
var parts = remoteAction.split('.');
var instance = this;
if (options && typeof options !== 'object') {
throw new Error('Options must be an object');
}
@marpstar
marpstar / something.js
Created December 22, 2014 06:23
JavaScript Gist Test
(function() {
var foo = window["bar"];
if(foo) {
setTimeout(function() {
alert("!");
});
}
})();
@marpstar
marpstar / gist:2b10ec02833700037e5a
Last active August 29, 2015 14:15
Idea Prompts
  • [Technology is about doing more with less][1].
  • Ask a non-coder
@marpstar
marpstar / MimeMapping.cs
Created February 25, 2015 16:06
MimeMapping class for MIME type.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MyApp
{
public static class MimeMapping
{
public static string GetContentType(string SourceFileName)
module SimpleExamples =
open System
type Customer(firstName: string) =
member this.FirstName = firstName