Skip to content

Instantly share code, notes, and snippets.

@cozingo
cozingo / ext.txt
Created July 25, 2018 06:11 — forked from chronon/ext.txt
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
@cozingo
cozingo / httpCodes.php
Created February 7, 2018 11:57 — forked from henriquemoody/http-status-codes.php
List of HTTP status codes in PHP
<?php
/**
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
**/
return array(
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing', // WebDAV; RFC 2518
200 => 'OK',
@cozingo
cozingo / PPTP.txt
Last active March 2, 2018 14:48 — forked from aioutecism/gist:2638bb9eaf9ffc13348c
Set up a VPN Server (PPTP) on AWS and use it anywhere
# Set up a VPN Server (PPTP) on AWS
1. Create a EC2 instance using `Ubuntu 14.04`.
2. In `Secure Group Inbound Rules`, add a `SSH Rule(TCP, Port 22, 0.0.0.0/0)` and a `Custom TCP Rule(TCP, Port 1723, 0.0.0.0/0)`.
3. Optional: Associate a Elastic IP with the instance.
4. SSH into the instance.
5. `sudo apt-get install pptpd`.
6. `sudo vim /etc/pptpd.conf`. Uncomment `localip 192.168.0.1` and `remoteip 192.168.0.234-238,192.168.0.245`.
7. `sudo vim /etc/ppp/pptpd-options`. Uncomment `ms-dns` and `ms-wins`. Change the IP to Google's DNS like this:
```
@cozingo
cozingo / example-component.ts
Created November 13, 2017 04:41 — forked from rjmccluskey/example-component.ts
Angular 2 Input with TypeScript property (getter and setter)
import { Component, Input } from '@angular/core';
@Component({
selector: 'example',
template: `{{data}}` // getting `data` in the template will call the getter method!
})
export class ExampleCoponent {
private dataInternal: number;
@Input() set data(data: number) {
@cozingo
cozingo / relative-date.pipe.ts
Created November 4, 2017 12:26 — forked from JonCatmull/relative-date.pipe.ts
Relative date Pipe for Angular2 + TypeScript . Convert date|timestamp into relative date string e.g. "5 days ago", "1 minute ago" etc.
import { Pipe, PipeTransform } from '@angular/core';
// Epochs
const epochs: any = [
['year', 31536000],
['month', 2592000],
['day', 86400],
['hour', 3600],
['minute', 60],
['second', 1]

Set the url with ?XDEBUG_SESSION_START=PHPSTORM and set a header Cookie: XDEBUG_SESSION=PHPSTORM