Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
| <?php namespace App\Providers; | |
| use Illuminate\Support\ServiceProvider; | |
| /** | |
| * If the incoming request is an OPTIONS request | |
| * we will register a handler for the requested route | |
| */ | |
| class CatchAllOptionsRequestsProvider extends ServiceProvider { |
| <?php | |
| function _delete_dir01($path) { | |
| if (!is_dir($path)) { | |
| throw new InvalidArgumentException("$path must be a directory"); | |
| } | |
| if (substr($path, strlen($path) - 1, 1) != DIRECTORY_SEPARATOR) { | |
| $path .= DIRECTORY_SEPARATOR; | |
| } | |
| $files = glob($path . '*', GLOB_MARK); |
| <?php | |
| function zip($source, $destination) | |
| { | |
| if (!extension_loaded('zip') || !file_exists($source)) { | |
| return false; | |
| } | |
| $zip = new ZipArchive(); | |
| if (!$zip->open($destination, ZIPARCHIVE::CREATE)) { |
| let hasBlobConstructor = typeof(Blob) !== 'undefined' && (function () { | |
| try { | |
| return Boolean(new Blob()); | |
| } catch (e) { | |
| return false; | |
| } | |
| }()); | |
| let hasArrayBufferViewSupport = hasBlobConstructor && typeof(Uint8Array) !== 'undefined' && (function () { | |
| try { |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
| import { Component, Input, AfterViewInit } from '@angular/core'; | |
| import { NgModel, DefaultValueAccessor, NgControl } from '@angular/forms'; | |
| import { Http, Headers, RequestOptions } from '@angular/http'; | |
| @Component({ | |
| selector: 'app-file-uploader', | |
| template: '<input type="file" (change)="updated($event);">', | |
| providers: [NgModel, DefaultValueAccessor] | |
| }) | |
| export class FileUploaderComponent implements AfterViewInit { |
| <form #cfForm="ngForm" (change)="formState(cfForm);"> | |
| <fieldset class="content-group" ngModelGroup="body"> | |
| <div class="form-group"> | |
| <label class="control-label col-lg-2">Kampanya Adı</label> | |
| <div class="col-lg-10"> | |
| <input name="name" type="text" class="form-control" placeholder="örn: ayakkabı sezonu" ngModel> | |
| </div> | |
| </div> | |
| <div class="form-group"> | |
| <label class="control-label col-lg-2">Kampanya Türü</label> |
| /* | |
| Here's some documentation on XMLHttpRequest Level 1 and 2 as per the | |
| standard and as per implementation. | |
| XHR | |
| http://www.w3.org/TR/XMLHttpRequest/ | |
| http://developer.apple.com/internet/webcontent/xmlhttpreq.html | |
| http://msdn.microsoft.com/en-us/library/ms535874%28VS.85%29.aspx | |
| XHR2 |
| app.use(function(req, res, next) { | |
| var oneof = false; | |
| if(req.headers.origin) { | |
| res.header('Access-Control-Allow-Origin', req.headers.origin); | |
| oneof = true; | |
| } | |
| if(req.headers['access-control-request-method']) { | |
| res.header('Access-Control-Allow-Methods', req.headers['access-control-request-method']); | |
| oneof = true; | |
| } |