Skip to content

Instantly share code, notes, and snippets.

View rvanlaak's full-sized avatar

Richard van Laak rvanlaak

  • Amsterdam, Netherlands
View GitHub Profile
@rvanlaak
rvanlaak / Add - Goto - Remove Bindings.yaml
Created December 19, 2018 14:36
Add - Goto - Remove Bindings
name: Blank snippet - 1
description: ''
author: rvanlaak
host: WORD
api_set: {}
script:
content: |
$("#add").click(() => tryCatch(addBindingFromSelection));
$("#goto").click(() => tryCatch(gotoBinding));
$("#remove").click(() => tryCatch(removeBinding));
@rvanlaak
rvanlaak / Blank snippet.yaml
Created August 14, 2018 07:56
Shared with Script Lab
name: Blank snippet
description: ''
author: rvanlaak
host: WORD
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
@rvanlaak
rvanlaak / test-phpstan.sh
Last active November 2, 2017 09:04
Gitlab CI runner to run PHPStan
#!/usr/bin/env bash
## Allows running the latest PHPStan version without having to install the project
##
## See repo at https://github.com/phpstan/phpstan
## Thanks to https://gist.github.com/steinwaywhw/a4cd19cda655b8249d908261a62687f8
URL=`curl -s https://api.github.com/repos/phpstan/phpstan/releases/latest \
| grep "browser_download_url.*phpstan.phar\"" \
| cut -d : -f 2,3 \
@rvanlaak
rvanlaak / function.php
Last active March 22, 2016 20:31
Check .doc and .docx for active file encryption
/**
* Check or the file is password protected based on the top file contents.
*
* @param string $absolutePath
* @return bool
*/
public function checkFileEncryption($absolutePath)
{
$content = utf8_encode(file_get_contents($absolutePath));
if (mb_substr($content, 0, 2) == "ÐÏ") {
@rvanlaak
rvanlaak / gist:d0c4c24cd8ad18e4b2bd
Last active August 29, 2015 14:06
Ladybug DateTime bug composer.lock
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "41268b2274b801d5ce161a06ab9b7623",
"packages": [
{
"name": "monolog/monolog",
@rvanlaak
rvanlaak / gist:9409592
Created March 7, 2014 11:04
FpnTaggingBundle complete entities. The getters/setters are inherited via the parents
<?php
namespace Acme\AppBundle\Entity\Tag;
use FPN\TagBundle\Entity\Tag as BaseTag;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="acme_tag")
* @ORM\Entity(repositoryClass="Acme\AppBundle\Entity\Tag\TagRepository")