Skip to content

Instantly share code, notes, and snippets.

@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');
@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;
}
@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
@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
{
@ivanvermeyen
ivanvermeyen / EnsureQueueListenerIsRunning.php
Last active February 13, 2024 12:40
Ensure that the Laravel queue listener is running with "php artisan queue:checkup" and restart it if necessary. You can run this automatically with a cron job: http://laravel.com/docs/scheduling
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueListenerIsRunning extends Command
{
/**
* The name and signature of the console command.
@resmall
resmall / gist:51b328aa303b15979e77
Last active December 18, 2024 03:38
Imports an sql file and execute the script in Laravel Seeder
public function run() {
DB::unprepared(File::get('path/to/SQL/file'));
}
@gamemachine
gamemachine / ItemCatalog.cs
Created September 12, 2015 23:43
Scriptablable object as protobuf message container
using UnityEngine;
using io.gamemachine.messages;
namespace GameMachine {
namespace ItemManagement {
[CreateAssetMenu(menuName =@"ItemCatalog")]
public class ItemCatalog : ScriptableProtobuf<PlayerItems> {
}
}
@davidalbers
davidalbers / TextOverAVRCP.java
Created September 4, 2015 18:39
Example for sending text over AVRCP from an Android application.
/**
* Generalized code from botifier, source code at https://github.com/grimpy/Botifier
* Provides example methods for sending text over AVRCP from an Android application.
* AVRCP is the Bluetooth protocol your phone uses to send song information to your car stereo/smartwatch.
* Only for Android 5.0+
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
//in activity or service
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
<?php sensei_simple_course_price( $course->ID ); ?>