Skip to content

Instantly share code, notes, and snippets.

Avatar

sicaboy sicaboy

  • Sydney, Australia
View GitHub Profile
@iamntz
iamntz / HandlePutFormData.php
Last active Jan 20, 2021 — forked from Stunext/HandlePutFormData.php
Laravel: Middleware to support multipart/form-data in PUT, PATH and DELETE requests. Deals with one level of form arrays.
View HandlePutFormData.php
<?php
namespace App\Http\Middleware;
use Closure;
use Symfony\Component\HttpFoundation\ParameterBag;
/**
* @author https://github.com/Stunext
*
* PHP, and by extension, Laravel does not support multipart/form-data requests when using any request method other than POST.
@sicaboy
sicaboy / .env.travis
Created Apr 17, 2018 — forked from qWici/.env.travis
Laravel 5.5 Travis CI config
View .env.travis
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
@mjul
mjul / docker-compose.yml
Created Apr 4, 2018
Elastic Search, Logstash and Kibana via docker-compose for parsing key=value style log files
View docker-compose.yml
version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.2
volumes:
- esdata:/usr/share/elasticsearch/data
ports:
- "9200:9200"
@qWici
qWici / .env.travis
Last active Feb 25, 2020 — forked from gilbitron/.env.travis
Laravel 5.5 Travis CI config
View .env.travis
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=root
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
@gupta-pratik
gupta-pratik / app.js
Last active Mar 9, 2020
AngularJs Authorization and permissions on routes and views.
View app.js
'use strict';
// Declare app level module which depends on views, and components
var app = angular.module('eopd', [
'ngRoute',
'app.directives'
'app.services'
])
.config([
'$locationProvider', '$routeProvider', '$httpProvider', 'ScrollBarsProvider', function ($locationProvider, $routeProvider, $httpProvider, ScrollBarsProvider) {
@simme
simme / debounce-throttle.swift
Created Dec 20, 2016
Swift 3 debounce & throttle
View debounce-throttle.swift
//
// debounce-throttle.swift
//
// Created by Simon Ljungberg on 19/12/16.
// License: MIT
//
import Foundation
extension TimeInterval {
View NGINX-GROK-ELASTICSEARCH.md

http://grokdebug.herokuapp.com

SAMPLE

127.0.0.1 - - [26/Mar/2016:19:09:19 -0400] "GET / HTTP/1.1" 401 194 "" "Mozilla/5.0 Gecko" "-"

MATCH

%{IPORHOST:clientip} (?:-|(%{WORD}.%{WORD})) %{USER:ident} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-) %{QS:referrer} %{QS:agent} %{QS:forwarder}

Output

View homebridge
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/lib/homebridge
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*
@gilbitron
gilbitron / .env.travis
Last active Aug 15, 2020
Laravel 5 Travis CI config
View .env.travis
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
@tlarevo
tlarevo / php-compatible-swift-aes-encryption-using-cryptoswift.swift
Last active Mar 20, 2020
PHP compatible AES Encryption and Decryption with Swift and CryptoSwift
View php-compatible-swift-aes-encryption-using-cryptoswift.swift
// Credit should be given to;
// https://gist.github.com/yutelin/f4f66e0c78474db1de51#file-string-aes-swift
// https://gist.github.com/bradbernard/2a7af4c2200cb3794768#file-swift-encryption
// And most importantly to https://github.com/krzyzanowskim/CryptoSwift
import Foundation
import CryptoSwift
extension String {