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
| #!/bin/bash | |
| # This one-liner script plays a video in an infinite loop on a raspberry pi | |
| # for a video-art exhibition. | |
| # It was written for a video in portrait orientation so the video is rotated 270 | |
| # to use up the whole screen (which was also rotated). | |
| # Charles Martin, July 2016 | |
| omxplayer -o local --loop /home/pi/video.mp4 --orientation 270 |
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
| function my_remove_wp_seo_meta_box() { | |
| remove_meta_box('wpseo_meta', YOUR_POST_TYPE_NAME_HERE, 'normal'); | |
| } | |
| add_action('add_meta_boxes', 'my_remove_wp_seo_meta_box', 100); |
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 | |
| namespace App\Http\Controllers; | |
| use App\Result; | |
| use Illuminate\Http\Request; | |
| use Symfony\Component\HttpFoundation\StreamedResponse; | |
| class ExportController extends Controller | |
| { |
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
| const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
| async function something() { | |
| console.log("this might take some time...."); | |
| await delay(5000); | |
| console.log("done!") | |
| } | |
| something(); |
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
| // !! this gist was created in 2015, it doesn't work on most modern distributions !! | |
| // e.g: get_ip("eth0"); | |
| function get_ip($interface) { | |
| $interface = escapeshellarg($interface); | |
| $pattern = "/inet addr:(\d+\.\d+\.\d+\.\d+)/"; | |
| $text = shell_exec("ifconfig $interface"); | |
| preg_match($pattern, $text, $matches); | |
| return $matches[1]; | |
| } |
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
| # Taxonomy terms: | |
| - https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php | |
| # Menu links: | |
| - https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php | |
| # File items: | |
| - https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php | |
| # Nodes: |
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
| var request = require("request"), | |
| cheerio = require("cheerio"), | |
| url = "https://www.google.com/search?q=data+mining", | |
| corpus = {}, | |
| totalResults = 0, | |
| resultsDownloaded = 0; | |
| function callback () { | |
| resultsDownloaded++; |
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
| var mediaJSON = { "categories" : [ { "name" : "Movies", | |
| "videos" : [ | |
| { "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
| "subtitle" : "By Blender Foundation", | |
| "thumb" : "images/BigBuckBunny.jpg", | |
| "title" : "Big Buck Bunny" | |
| }, | |
| { "description" : "The first Blender Open Movie from 2006", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
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
| /** | |
| * JavaScript code to detect available availability of a | |
| * particular font in a browser using JavaScript and CSS. | |
| * | |
| * Author : Lalit Patel | |
| * Website: http://www.lalit.org/lab/javascript-css-font-detect/ | |
| * License: Apache Software License 2.0 | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * Version: 0.15 (21 Sep 2009) | |
| * Changed comparision font to default from sans-default-default, |
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 | |
| /* | |
| Plugin Name: Admin Filter BY Custom Fields | |
| Plugin URI: http://en.bainternet.info | |
| Description: Filter posts or pages in admin by custom fields (post meta) | |
| Version: 1.0 | |
| Author: Bainternet | |
| Author URI: http://en.bainternet.info | |
| */ |