Skip to content

Instantly share code, notes, and snippets.

View wstam88's full-sized avatar

Wesley wstam88

  • Netherlands, Amsterdam
View GitHub Profile
@wstam88
wstam88 / README.md
Created October 27, 2015 18:42 — forked from joyrexus/README.md
Form/file uploads with hapi.js

Demo of multipart form/file uploading with hapi.js.

Usage

npm install
npm run setup
npm run server

Then ...

@wstam88
wstam88 / SassMeister-input-HTML.haml
Created October 30, 2015 11:35
Generated by SassMeister.com.
%ul.rating
- (1..5).each do |i|
%li(class="star-#{i}")
%input(type="radio" id="rating-star-#{i}" name="rating" value="#{i}")
%label(for="rating-star-#{i}") #{i} stars
%ul.rating2
- (1..8).each do |i|
%li(class="star-#{i}")
%input(type="radio" id="rating2-star-#{i}" name="rating-2" value="#{i}")
@wstam88
wstam88 / angularjs-interceptor.js
Created October 31, 2015 13:50 — forked from gnomeontherun/angularjs-interceptor.js
Intercept XHR/Ajax requests with AngularJS http interceptors. This allows you to globally intercept and modify requests and responses. You don't need to declare all of the methods, just the ones you need. Some example uses would be logging errors, adding extra headers, or triggering 'loading' screens. This intercepts ALL requests/responses, so y…
// Intercepting HTTP calls with AngularJS.
angular.module('MyApp', [])
.config(function ($provide, $httpProvider) {
// Intercept http calls.
$provide.factory('MyHttpInterceptor', function ($q) {
return {
// On request success
request: function (config) {
// console.log(config); // Contains the data about the request before it is sent.
@wstam88
wstam88 / gist:209ca2a99b08854a6876
Created November 18, 2015 12:59 — forked from learncodeacademy/gist:ebba574fc3f438c851ae
Nginx Node Frontend / Load Balancer / Static Assets Caching
upstream project {
server 22.22.22.2:3000;
server 22.22.22.3:3000;
server 22.22.22.5:3000;
}
server {
listen 80;
location / {
@wstam88
wstam88 / README.md
Created November 25, 2015 08:49 — forked from kentcdodds/README.md
upload-file

upload-file angular-formly type

This is my upload-file type for what I use at work. We use angular-upload for the upload service to do the actual file uploading. We also have several abstractions and use ES6 that may confuse you a little bit (sorry about that). Hopefully this gets you started though.

@wstam88
wstam88 / bootstrap-breakpoints.sass
Created April 17, 2016 08:06 — forked from webinfinita/bootstrap-breakpoints.sass
Variables for responsive design in bootstrap with sass
@mixin breakpoint($point)
@if $point == lg
@media (min-width: 1200px)
@content
@else if $point == md
@media (min-width: 992px) and (max-width: 1199px)
@content
@else if $point == sm
@wstam88
wstam88 / sites-available_angularjs_html5
Created April 18, 2016 10:45 — forked from demisx/sites-available_angularjs_html5
Nginx config for HTML5 AngularJS applications
server {
listen 8000;
server_name localhost;
root /Users/dmoore/projects/tutorials/angular-phonecat2/.build;
access_log "/Users/dmoore/projects/tutorials/angular-phonecat2/logs/hotili-net.access.log";
error_log "/Users/dmoore/projects/tutorials/angular-phonecat2/logs/hotili-net.error.log";
error_page 404 /app/404.html;
error_page 403 /app/403.html;
@wstam88
wstam88 / install-comodo-ssl-cert-for-nginx.rst
Created April 19, 2016 12:01 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@wstam88
wstam88 / all-templates.html
Created May 19, 2016 14:20 — forked from vojtajina/all-templates.html
AngularJS: load all templates in one file
<script type="text/ng-template" id="one.html">
<div>This is first template</div>
</script>
<script type="text/ng-template" id="two.html">
<div>This is second template</div>
</script>
@wstam88
wstam88 / gulpfile.js
Created May 22, 2016 06:48 — forked from edouard-lopez/gulpfile.js
Gulp copy font-awesome files to dist/ directory
'use strict';
// Generated on 2014-04-14 using generator-leaflet 0.0.14
var gulp = require('gulp');
var open = require('open');
var wiredep = require('wiredep').stream;
// Load plugins
var $ = require('gulp-load-plugins')();