Skip to content

Instantly share code, notes, and snippets.

@macghriogair
macghriogair / gist:7909f5c24f8c742ce2e6
Created March 20, 2016 14:23
stream csv file lumen
<?php
namespace App\Http\Controllers;
use App\Result;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\StreamedResponse;
class ExportController extends Controller
{
@brandongoode
brandongoode / comment-example.js
Created August 11, 2016 13:16
Dynamoose range and hash key example
var commentSchema = new Schema({
postId: {
type: String,
hashKey: true
},
id: {
type: String,
rangeKey: true,
default: shortId.generate
@hdodov
hdodov / iframechange.js
Last active April 3, 2025 08:13
HTML iframe URL change listener for tracking when a new iframe page starts to load
function iframeURLChange(iframe, callback) {
var lastDispatched = null;
var dispatchChange = function () {
var newHref = iframe.contentWindow.location.href;
if (newHref !== lastDispatched) {
callback(newHref);
lastDispatched = newHref;
}
@RaschidJFR
RaschidJFR / increment_version.js
Last active October 8, 2023 03:37
This script is a simple Cordova hook to incremente Version number each time you build.
#!/usr/bin/env node
// This script increments patch number (mayor.minor.patch) but you can
// choose to increment any other segment by modifying lines `45` to `53`.
//
// 1. Make sure you've installed *xml2js*: `$ npm install xml2js -D`
// 2. Save this file under `project_root/hooks/before_prepare/`
// 3. Done!
var fs = require('fs');
var xml2js = require('xml2js');