Skip to content

Instantly share code, notes, and snippets.

View CasperLaiTW's full-sized avatar
🏠
Working in home

Casper Lai CasperLaiTW

🏠
Working in home
  • VoH inc.
  • Taichung, Taiwan
View GitHub Profile
@cviebrock
cviebrock / ElasticLoggingProvider.php
Created September 29, 2016 14:57
Log Laravel to Elastic/Logstash
<?php namespace App\Providers;
use Elastica\Client;
use Illuminate\Support\ServiceProvider;
use Monolog\Formatter\LogstashFormatter;
use Monolog\Handler\ElasticSearchHandler;
class ElasticLoggingProvider extends ServiceProvider
{
@vluzrmos
vluzrmos / App_Http_VideoStream.php
Last active February 14, 2024 22:00
Laravel VideoStream.
<?php
namespace App\Http;
/**
* Description of VideoStream
*
* @author Rana
* @link https://gist.github.com/vluzrmos/d5682ad426525196d069
*/
@pauly4it
pauly4it / androidPurchaseReceipt.json
Created June 11, 2015 04:02
All code for Validating Android In-App Purchases With Laravel blog post: http://blog.goforyt.com/validating-android-app-purchases-laravel/
{
"receipt": {
"type": "android-playstore",
"id": "12345678901234567890.1234567890123456",
"purchaseToken": "purchase token goes here",
"receipt": "{"orderId":"12345678901234567890.1234567890123456","packageName":"com.example.app","productId":"com.example.app.product","purchaseTime":1417113074914,"purchaseState":0,"purchaseToken":"purchase token goes here"}",
"signature": "signature data goes here"
}
}
@jaceju
jaceju / gulpfile-for-laravel-42.js
Last active August 29, 2015 14:07
Gulpfile for Laravel 4.2
'use strict';
/////// COMMON ///////
var gulp = require('gulp');
var del = require('del');
var path = require('path');
var runSequence = require('run-sequence');
// Load plugins
@eiriklv
eiriklv / component-using-mixin.js
Last active June 4, 2019 09:09
React Masonry Mixin Example
/** @jsx React.DOM */
'use strict';
var React = require('react');
var MasonryMixin = require('./react-masonry-mixin.js');
var masonryOptions = {
transitionDuration: 0
@isimmons
isimmons / gulpfile.js
Last active August 29, 2015 13:55
gulpfile for gulp.js + Laravel: Compile sass/coffee, run phpunit tests, livereload css, js, and blade templates
/*
See dev dependencies https://gist.github.com/isimmons/8927890
Compiles sass to compressed css with autoprefixing
Compiles coffee to javascript
Livereloads on changes to coffee, sass, and blade templates
Runs PHPUnit tests
Watches sass, coffee, blade, and phpunit
Default tasks sass, coffee, phpunit, watch
*/
@cjonstrup
cjonstrup / Laravel\app\commands\ViewsCommand.php
Last active August 1, 2019 21:17
Clear Laravel 4.* app/storage/views artisan views:clear
<?php
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
class ViewsCommand extends Command {
/**
* The console command name.
*
* @var string
@Stanback
Stanback / nginx.conf
Last active February 4, 2022 18:05
Example Nginx configuration for serving pre-rendered HTML from Javascript pages/apps using the Prerender Service (https://github.com/collectiveip/prerender).Instead of using try_files (which can cause unnecessary overhead on busy servers), you could check $uri for specific file extensions and set $prerender appropriately.
# Note (November 2016):
# This config is rather outdated and left here for historical reasons, please refer to prerender.io for the latest setup information
# Serving static html to Googlebot is now considered bad practice as you should be using the escaped fragment crawling protocol
server {
listen 80;
listen [::]:80;
server_name yourserver.com;
root /path/to/your/htdocs;