A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.
Running a local server for testing purposes:
| // Usage: | |
| // get_id_by_slug('any-page-slug'); | |
| function get_id_by_slug($page_slug) { | |
| $page = get_page_by_path($page_slug); | |
| if ($page) { | |
| return $page->ID; | |
| } else { | |
| return null; | |
| } |
A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.
Running a local server for testing purposes:
| # Ignore docs files | |
| styles/.sass-cache | |
| styles/.sass-cache/* | |
| # Not working? | |
| # Try: http://stackoverflow.com/questions/11451535/gitignore-not-working | |
| # Try: http://stackoverflow.com/questions/1139762/gitignore-file-not-ignoring |
| #!/usr/bin/env xcrun swift | |
| import Foundation | |
| let kDelayUSec : useconds_t = 500_000 | |
| func DragMouse(from p0: CGPoint, to p1: CGPoint) { | |
| let mouseDown = CGEventCreateMouseEvent(nil, .LeftMouseDown, p0, .Left) | |
| let mouseDrag = CGEventCreateMouseEvent(nil, .LeftMouseDragged, p1, .Left) | |
| let mouseUp = CGEventCreateMouseEvent(nil, .LeftMouseUp, p1, .Left) |
| set theProcessName to "iOS Simulator" | |
| set theWindowNumber to 1 | |
| tell application "System Events" | |
| tell process theProcessName | |
| activate | |
| tell window theWindowNumber | |
| set thePosition to position | |
| set theSize to size | |
| end tell |
| import React from 'react'; | |
| let lastScrollY = 0; | |
| let ticking = false; | |
| class App extends React.Component { | |
| componentDidMount() { | |
| window.addEventListener('scroll', this.handleScroll, true); | |
| } |
| ffmpeg -i <infile> -ac 2 -f wav <outfile> |
| /** | |
| * Prepend a namespace in WordPress body_class() function | |
| * @param string $prefix The desired prefix | |
| * @param string $classes Additional classes separated by single space | |
| * @return string Single space separated list of classes | |
| */ | |
| function body_class_prefix($prefix, $classes = '') | |
| { | |
| global $wp_query; | |
| $output = ''; |
| /** | |
| * | |
| * Created by shelbysturgis on 1/23/14. | |
| */ | |
| define(['scripts/d3.v3', 'scripts/elasticsearch', 'scripts/c3/c3'], function (d3, elasticsearch) { | |
| "use strict"; | |
| var client = new elasticsearch.Client({ | |
| host: 'http://elasticsearch-abraverm.rhcloud.com/elasticsearch', |