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
// ==UserScript== | |
// @name Favro Bulk Restore | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://favro.com/* | |
// @grant unsafeWindow | |
// ==/UserScript== |
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 | |
return PhpCsFixer\Config::create() | |
->setRules([ | |
'@PSR2' => true, | |
'@Symfony' => true, | |
'@PHP70Migration' => true, | |
/* | |
* Enforce some structure! | |
*/ |
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 | |
$finder = PhpCsFixer\Finder::create(); | |
return PhpCsFixer\Config::create() | |
->setRules([ | |
'@PSR2' => true, | |
'@Symfony' => true, | |
'@PHP70Migration' => 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 | |
error_reporting(E_ALL); | |
ini_set("display_errors", 1); | |
$appUrl = 'http://samenzwolle.bijna.live/api/activities'; | |
$apiKey = '$2y$10$WaWaK1rIVzjiIYh4gkbl.uexHS8dMNBSfcPOO1l3/9k8V4xnQUwBi'; | |
$body = "{\"name\":\"Voorbeeld activiteit\",\"description\":\"Dit is een omschrijving\",\"start_date\":[\"09-05-2016 00:00\",\"11-05-2016 00:00\"],\"end_date\":[\"10-05-2016 00:00\",\"12-05-2016 00:00\"],\"url_email\":\"https://example.com/activities/1\",\"street\":\"Wilhelm Rontgenstraat\",\"house_number\":\"11B\",\"zipcode\":\"8013NE\",\"postbox\":\"-\",\"image1\":\"http://lorempixel.com/400/200/\",\"image2\":\"http://lorempixel.com/400/200/\",\"image3\":\"http://lorempixel.com/400/200/\",\"agreement\":\"1\"}"; | |
$curl = curl_init(); |
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
#!/bin/sh | |
# | |
# 1. Delete the .git directory locally. | |
# 2. Recreate the git repostory: | |
$ cd (project-directory) | |
$ git init | |
$ (add some files) | |
$ git add . | |
$ git commit -m 'Initial commit' |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
/** | |
* returns a WP_Query instance which generates a list of news items which have the same theme taxonomy as the given post. | |
* If not post is given the global post will be used | |
* | |
* @param null $postId | |
* @param [] $query | |
* | |
* @return WP_Query | |
*/ |
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 | |
/** | |
* ACF has this fancy option to show ACF fields based on pages templates. | |
* One problem: Themosis templates are not registered as "default" WordPress templates. | |
* This file hooks into the acf filters and allows ACF to use the Themosis templates. | |
*/ | |
// add themosis templates | |
add_filter('acf/location/rule_values/page_template', 'add_themosis_templates_to_acf_rules'); | |
function add_themosis_templates_to_acf_rules($choices) |
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 | |
/*----------------------------------------------------*/ | |
// Local environment vars | |
/*----------------------------------------------------*/ | |
{% set db_name = '{!Database name?[]?|wordpress!}' %} | |
{% set db_user = '{!Database user []?|=ENV[USER]!}' %} | |
{% set db_password = '{!Database password?!}' %} | |
{% set db_host = '{!Database host []?|localhost!}' %} | |
{% set db_home = '{!Wordpress home url []?|http://mysite.dev/!}' %} | |
{% set db_siteurl = '{!Wordpress site url []?|http://mysite.dev/cms/!}' %} |
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
AnswerSchema = new SimpleSchema(_.extend({ | |
body: { | |
type: String | |
}, | |
questionId: { | |
type: String | |
}, | |
upvotes: { | |
type: Number, | |
optional: true, |
NewerOlder