Skip to content

Instantly share code, notes, and snippets.

View chellem's full-sized avatar
🎯
Focusing

Dickriven Chellemboyee chellem

🎯
Focusing
View GitHub Profile
@wowo
wowo / PHPUnit way to mock Doctrine2 Entity Manager.php
Created November 1, 2011 20:22
PHPUnit's way to mock Doctrine2 Entity Manager
<?php
class AbstractManagerBase extends \PHPUnit_Framework_TestCase
{
protected function getEmMock()
{
$emMock = $this->getMock('\Doctrine\ORM\EntityManager',
array('getRepository', 'getClassMetadata', 'persist', 'flush'), array(), '', false);
$emMock->expects($this->any())
->method('getRepository')
@brianherbert
brianherbert / iso_array.php
Created January 27, 2012 07:35
ISO 3166-1 alpha-3 PHP Array
<?php
$iso_array = array(
'ABW'=>'Aruba',
'AFG'=>'Afghanistan',
'AGO'=>'Angola',
'AIA'=>'Anguilla',
'ALA'=>'Åland Islands',
'ALB'=>'Albania',
'AND'=>'Andorra',
'ARE'=>'United Arab Emirates',
@frsyuki
frsyuki / my_thoughts_on_msgpack.md
Created June 11, 2012 02:36
My thoughts on MessagePack

My thoughts on MessagePack

Hi. My name is Sadayuki "Sada" Furuhashi. I am the author of the MessagePack serialization format as well as its implementation in C/C++/Ruby.

Recently, MessagePack made it to the front page of Hacker News with this blog entry by Olaf, the creator of the Facebook game ZeroPilot. In the comment thread, there were several criticisms for the blog post as well as MessagePack itself, and I thought this was a good opportunity for me to address the questions and share my thoughts.

My high-level response to the comments

To the best of my understanding, roughly speaking, the criticisms fell into the following two categories.

@magnetikonline
magnetikonline / README.md
Last active March 14, 2024 22:48
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@Stanback
Stanback / nginx.conf
Last active June 14, 2024 10:21 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@mark47
mark47 / datatables.datetime-flex.js
Last active March 18, 2019 06:18
Plugin for jQuery Datatables sorting of US-style date and time. Requires month, day and year. Time is optional and can be in 12 or 24 hour formats. Properly parses mm/m, dd/d and yyyy/yy.
/**
* DataTables plug-in to handle U.S.-style dates. Requires month day year.
* Time is optional and can be in 12 or 24 hour formats.
* Properly parses mm/m, dd/d and yyyy/yy.
*
* Based on original datetime-us plugin by Kevin Gravier.
*
* @name Flexible US Datetime
* @summary Sort dates and times in US mm/dd/yyyy with optional time.
* @author Mark Stewart
@tjamps
tjamps / README.md
Last active February 29, 2024 14:57
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@jonatanrdsantos
jonatanrdsantos / curl-problem.md
Last active August 21, 2020 05:23
curl port 443: Network is unreachable problem

How to solve the curl port 443: Network is unreachable problem:

joridos@localhost:~/Documents/github$ opam init
default    Downloading https://opam.ocaml.org/urls.txt
'opam init' failed.
# opam-version    1.1.1
# os              linux
Cannot download https://opam.ocaml.org/urls.txt, please check your connection settings.
joridos@localhost:~/Documents/github$ curl https://opam.ocaml.org/urls.txt
@vinnybad
vinnybad / Fastfile
Created June 3, 2016 19:16
Shows one way to fail a build in fastlane when code coverage does not meet a minimum threshold.
#
# Shows one way to fail a build in fastlane when code
# coverage does not meet a minimum threshold.
#
# there are other ways to check the coverage of the commit,
# but I couldn't find an existing tool that makes this easier
# that will run on bitrise. I would have normally used diff-cover
# to do this because you can compare branches and only check the diffs.
# Unfortunately that means you have to find a way to install it on bitrise
# at the time of writing and that can be tricky.
@teriiehina
teriiehina / super_xcov.rb
Created June 7, 2016 10:28
Hacky way to get code coverage from xcov in a Fastlane lane
module Fastlane
module Actions
module SharedValues
SUPER_XCOV_CODE_COVERAGE = :SUPER_XCOV_CODE_COVERAGE
end
class SuperXcovAction < Action
def self.run(options)
Actions.verify_gem!('xcov')
require 'xcov'