Skip to content

Instantly share code, notes, and snippets.

@veslo1
veslo1 / MimeTypes.php
Created October 27, 2017 14:49 — forked from nimasdj/MimeTypes.php
List of MimeTypes mapped to file extensions
<?php
// I made this array by joining all the following lists + .php extension which is missing in all of them.
// please contribute to this list to make it as accurate and complete as possible.
// https://gist.github.com/plasticbrain/3887245
// http://pastie.org/5668002
// http://pastebin.com/iuTy6K6d
// total: 1223 extensions as of 16 November 2015
$mime_types = array(
'3dm' => array('x-world/x-3dmf'),
'3dmf' => array('x-world/x-3dmf'),
@veslo1
veslo1 / README.md
Created August 7, 2017 11:19 — forked from sj26/README.md
Run MailCatcher in the background, always, on OS X

Place me.mailcatcher.plist into ~/Library/LaunchAgents, then run launchctl load ~/Library/LaunchAgents/me.mailcatcher.plist.

If you use pow, echo 1080 > ~/.pow/mailcatcher and go to http://mailcatcher.dev, otherwise use http://localhost:1080.

Currently pow doesn't seem to pass websockets through correctly. Looking into this.

@veslo1
veslo1 / encoding-video.md
Created December 17, 2016 23:05 — forked from glen-cheney/encoding-video.md
Encoding Video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aacc --with-opus
@veslo1
veslo1 / PushNotifications.php
Created August 26, 2016 15:56 — forked from joashp/PushNotifications.php
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
@veslo1
veslo1 / gist:bb2d53bd7f487f7ab5908602bb8b3009
Created August 4, 2016 18:45 — forked from lylepratt/gist:d8bf84b3b7d6932e3549
Grunt Task to Generate Manifest for cordova-app-loader
/* This generates a manifest file for use with the cordova-app-loader tool:
* https://github.com/markmarijnissen/cordova-app-loader
*/
/*
* You can add settings to your grunt initConfig
//jsonmanifest settings
jsonmanifest: {
generate: {
@veslo1
veslo1 / README.md
Created August 4, 2016 11:34 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@veslo1
veslo1 / post-receive
Created July 25, 2016 13:47
git post-merge hook : update / install composer packages & composer itself
#!/bin/bash
# thanks http://www.jenssegers.be/blog/46/deploying-websites-with-git-and-composer-
# replace folder
cd "`dirname $0`/../../application/config"
# Check if a composer.json file is present
if [ -f composer.json ]; then
@veslo1
veslo1 / custom-submit.js
Last active September 3, 2015 19:14
[AngularJS] Custom submit handler that will only submit when all validation is passed
/**
* Custom submit directive that will only submit when all the validation has passed
* for all the fields. This extends on the ng-submit directive provided by AngularJS.
*
* This directive will also remove the 'pristine' flag from all the fields when
* hitting submit, allowing the form to display no errors until the submit button
* is clicked/enter is pressed.
*
* The variable 'app' is the instance of a module.
* E.g. var app = angular.module('my-app', []);
#!/usr/bin/env bash
# Specify where we will install
# the tenantcloud.l certificate
SSL_DIR="/etc/ssl/tenantcloud.l"
# Set the wildcarded domain
# we want to use
DOMAIN="*.tenantcloud.l"
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant