Skip to content

Instantly share code, notes, and snippets.

@mirr
mirr / after.sh
Created September 18, 2016 17:16
php7.0-phalcon [laravel/homestead]
#!/bin/sh
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
#
# Install Phalcon
######################## START ##############################
phalcon_so="`php-config --extension-dir`/phalcon.so"
@mirr
mirr / Skyscanner.php
Created October 12, 2016 06:34
Create session key and pull json data
<?php
class Skyscanner
{
public function getFlightsTest()
{
$apikey = ''; // enter your api key
$url = 'http://business.skyscanner.net/apiservices/pricing/v1.0/';
$params = array(
"country" => "GB",
@mirr
mirr / README.markdown
Created March 23, 2017 03:36 — forked from marijn/README.markdown
List of nationalities in YAML, CSV and TXT format

List of nationalities

It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.

##List of countries

I've also compiled a list of countries

<?php # -*- coding: utf-8 -*-
/**
* Create a nav menu with very basic markup.
*
* @author Thomas Scholz http://toscho.de
* @version 1.0
*/
class T5_Nav_Menu_Walker extends Walker_Nav_Menu
{
/**
@mirr
mirr / localStorage.js
Created June 2, 2018 05:36 — forked from sanusart/localStorage.js
Jest mock localStorage #test #jest
// ./__mocks__/localStorage.js
let mockStorage = {};
module.exports = window.localStorage = {
setItem: (key, val) => Object.assign(mockStorage, {[key]: val}),
getItem: (key) => mockStorage[key],
clear: () => mockStorage = {}
};
<?php
/**
* Existence of Composition class requires that an external object of
* class B is passed in on construction
*
* UML Explanation - The object at this role contains the object at the opposite role.
*
* Alternatively stated, an object of class Composition cannot be created without
* an object of class B (in this case through dependency injection)
@mirr
mirr / phpmd.xml
Created August 30, 2018 12:10 — forked from dimamix/phpmd.xml
phpmd.xml example
<?xml version="1.0"?>
<ruleset>
<description>Custom ruleset for Behance code standards</description>
<!-- Rues are imported individually to allow for easy configuration -->
<!-- Property names and values can be found here: http://phpmd.org/rules/index.html -->
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength">
<properties>
@mirr
mirr / token-generator.js
Created October 16, 2018 03:04 — forked from ziluvatar/token-generator.js
Example of refreshing tokens with jwt
/**
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken
* It was requested to be introduced at as part of the jsonwebtoken library,
* since we feel it does not add too much value but it will add code to mantain
* we won't include it.
*
* I create this gist just to help those who want to auto-refresh JWTs.
*/
const jwt = require('jsonwebtoken');
@mirr
mirr / 00. tutorial.md
Created February 1, 2019 12:23 — forked from maxivak/00. tutorial.md
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
@mirr
mirr / terminal-git-branch-name.md
Created February 20, 2019 11:45 — forked from joseluisq/terminal-git-branch-name.md
Add Git Branch Name to Terminal Prompt (Mac)

Add Git Branch Name to Terminal Prompt (Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {