sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
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
const CDP = require('chrome-remote-interface'); | |
const argv = require('minimist')(process.argv.slice(2)); | |
const file = require('fs'); | |
// CLI Args | |
const url = argv.url || 'https://www.google.com'; | |
const format = argv.format === 'jpeg' ? 'jpeg' : 'png'; | |
const viewportWidth = argv.viewportWidth || 1440; | |
const viewportHeight = argv.viewportHeight || 900; | |
const delay = argv.delay || 0; |
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 | |
namespace App\Events; | |
use Illuminate\Contracts\Broadcasting\ShouldBroadcast; | |
use Illuminate\Queue\SerializesModels; | |
class NewMessage extends Event implements ShouldBroadcast | |
{ | |
The plan is to create a pair of executables (ngrok
and ngrokd
) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok
to connect to this ngrokd
, and vice versa.
Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com
, you'll need a record for that and for *.domain.com
.
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 | |
/* build a new wp_query */ | |
$classes = new WP_Query( | |
array( | |
'post_type' => 'wpmark_class_time', // post type to query | |
'posts_per_page' => -1, // get all the posts not limited | |
'meta_query' => array( | |
'relation' => 'AND', | |
'day' => array( // give the first meta key array an array key | |
'key' => '_wpmark_day', |
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
angular.module('Demo', ['ionic', 'Demo.controllers', 'Demo.services', 'ngCordova']) | |
.run(function ($ionicPlatform, sqliteService) { | |
$ionicPlatform.ready(function () { | |
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard | |
// for form inputs) | |
if (window.cordova && window.cordova.plugins.Keyboard) { | |
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); | |
cordova.plugins.Keyboard.disableScroll(true); |
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 | |
namespace Fry; | |
use JsonStreamingParser\Listener; | |
/** | |
* This implementation allows to process an object at a specific level | |
* when it has been fully parsed | |
*/ | |
class ObjectListener implements Listener | |
{ |
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
// context: https://twitter.com/codepo8/status/572863924887945216 | |
function fuzzysearch(query, text) { | |
// Build a regex, then test text against it: | |
return RegExp( | |
query | |
// Escape any special regex characters: | |
.replace(/[.*+?^${}()|[\]\/\\]/g, '\\$&') | |
// Any escaped or non-escaped character can be followed by | |
// any number of other characters (.*): |
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
# ----------------------------------------------------------------- | |
# .gitignore for WordPress @salcode | |
# ver 20180808 | |
# | |
# From the root of your project run | |
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore | |
# to download this file | |
# | |
# By default all files are ignored. You'll need to whitelist | |
# any mu-plugins, plugins, or themes you want to include in the repo. |
download and install Solr from http://lucene.apache.org/solr/.
you can access Solr admin from your browser: http://localhost:8983/solr/
use the port number used in installation.
NewerOlder