View $slug.jsx
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
import { json } from 'remix' | |
import { gql } from 'graphql-request' | |
import { gqlClient } from 'graphql.server' | |
export const loader = async ({ request }) => { | |
const { entries } = await gqlClient(request).request(gql` | |
{ | |
YOUR GRAPHQL QUERY HERE | |
} | |
`) |
View action.jsx
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
import { | |
useActionData, | |
Form, | |
redirect, | |
json | |
} from 'remix' | |
export async function action({ request }) { | |
const formData = await request.formData() | |
const errors = {} |
View Standard.json
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
{ | |
"buttons": [ | |
"html", | |
"formatting", | |
"bold", | |
"italic", | |
"unorderedlist", | |
"orderedlist", | |
"link", | |
"image", |
View external-links.js
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
module.exports = { | |
init: function() { | |
this.setVars(); | |
this.addAttributes(); | |
}, | |
setVars: function() { | |
this.links = document.querySelectorAll('a[href^="http"]:not([href^="' + window.location.origin + '"])'); | |
}, |
View gist:2b3488fe9587be959a46
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 | |
public function getEmbedCode($url) | |
{ | |
if (strpos($url, 'youtube') !== FALSE) { | |
$url_parts = parse_url($url); | |
parse_str($url_parts['query'], $segments); | |
return '//www.youtube.com/embed/' . $segments['v']; | |
} else if (strpos($url, 'vimeo') !== FALSE) { |
View gist:9621117
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
var $body = $('body'); | |
if (!$body.hasClass('whatever')) { | |
var header_wrap = $('#header-wrap'); | |
var sticky_navigation_offset_top = header_wrap.offset().top; | |
var sticky_navigation = function() { | |
var scroll_top = $(window).scrollTop(); | |
if (scroll_top > sticky_navigation_offset_top) { |
View pi.php
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 | |
public function in_array() | |
{ | |
$haystack = $this->EE->TMPL->fetch_param('haystack', NULL); | |
$needle = $this->EE->TMPL->fetch_param('needle', NULL); | |
if ($haystack === NULL || $needle === NULL) { | |
return; | |
} |
View jquery.tabs.js
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
/** | |
* @name jQuery Tabs | |
* @author Trevor Davis | |
* @copyright (cc) Trevor Davis (http://www.viget.com) | |
* | |
* Licensed under the CC-GNU GPL (http://creativecommons.org/licenses/GPL/2.0/) | |
*/ | |
;(function($, window, document, undefined) { | |
var Tabs = function(elem, options) { |
View pi.auto_link.php
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
/** | |
* Add http:// to links if there isn't one | |
*/ | |
public function auto_link() { | |
$url = $this->EE->TMPL->fetch_param('url', NULL); | |
if ($url) { | |
$http = stripos($url, 'http://'); | |
$https = stripos($url, 'https://'); |
View pi.auto_link.php
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
/** | |
* Add http:// to links if there isn't one | |
*/ | |
public function auto_link() { | |
$url = $this->EE->TMPL->fetch_param('url', NULL); | |
if ($url) { | |
$http = stripos($url, 'http://'); | |
$https = stripos($url, 'https://'); |
NewerOlder