fetch('/things/10', {
credentials: 'same-origin',
headers: {
'accept': 'application/json'
}
This file contains hidden or 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
| /* | |
| * Save a text file locally with a filename by triggering a download | |
| */ | |
| var text = "hello world", | |
| blob = new Blob([text], { type: 'text/plain' }), | |
| anchor = document.createElement('a'); | |
| anchor.download = "hello.txt"; | |
| anchor.href = (window.webkitURL || window.URL).createObjectURL(blob); |
This file contains hidden or 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
| /** | |
| * Deep diff between two object, using lodash | |
| * @param {Object} object Object compared | |
| * @param {Object} base Object to compare with | |
| * @return {Object} Return a new object who represent the diff | |
| */ | |
| function difference(object, base) { | |
| function changes(object, base) { | |
| return _.transform(object, function(result, value, key) { | |
| if (!_.isEqual(value, base[key])) { |
This file contains hidden or 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
| <template> | |
| <file-input v-model="filename" @formData="formData"> | |
| <v-btn @click.native="uploadFiles"> | |
| </template> | |
| <script> | |
| import fileInput from './file-input.vue' | |
| export default{ | |
| components:{fileInput} |
This file contains hidden or 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
| // class manipulation from http://www.openjs.com/scripts/dom/class_manipulation.php | |
| function hasClass(ele,cls) { | |
| return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')); | |
| } | |
| function addClass(ele,cls) { | |
| if (!this.hasClass(ele,cls)) ele.className += " "+cls; | |
| } | |
| function removeClass(ele,cls) { |
This file contains hidden or 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 | |
| /* Pull apart OEmbed video link to get thumbnails out*/ | |
| function get_video_thumbnail_uri( $video_uri ) { | |
| $thumbnail_uri = ''; | |
| // determine the type of video and the video id | |
| $video = parse_video_uri( $video_uri ); | |
| // get youtube thumbnail |
This file contains hidden or 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 | |
| /* | |
| ############################## | |
| ########### Search ########### | |
| ############################## | |
| Included are steps to help make this script easier for other to follow | |
| All you have to do is add custom ACF post types into Step 1 and custom taxonomies into Step 10 | |
| I also updated this work to include XSS and SQL injection projection | |
| [list_searcheable_acf list all the custom fields we want to include in our search query] |
This file contains hidden or 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
| /** | |
| * | |
| * Filter Yoast SEO Metabox Priority | |
| * @author Jacob Wise | |
| * @link http://swellfire.com/code/filter-yoast-seo-metabox-priority | |
| * | |
| */ | |
| add_filter( 'wpseo_metabox_prio', 'jw_filter_yoast_seo_metabox' ); | |
| function jw_filter_yoast_seo_metabox() { | |
| return 'high'; |