Skip to content

Instantly share code, notes, and snippets.

View msurguy's full-sized avatar

Maksim Surguy msurguy

View GitHub Profile
@msurguy
msurguy / List.md
Last active November 29, 2025 02:37
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@msurguy
msurguy / DB.sql
Last active March 21, 2025 14:46
Dynamic dropdown in Laravel, let's say you have multiple drop downs (selects), you click on one and the contents of the other need to be dynamically changed. One solution is to dynamically load JSON from the API and change the dropdown dynamically depending on the user choice.
CREATE TABLE `makers` (
`id` int(10) unsigned NOT NULL,
`name` varchar(255) NOT NULL,
`description` varchar(255) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
@msurguy
msurguy / README.md
Created December 17, 2024 22:29 — forked from cjlawson02/README.md
Repurposing an Android Digital Photo Frame as a Home Assistant Dashboard

Repurposing an Android Digital Photo Frame as a Home Assistant Dashboard

This project is a simple way to repurpose a digital photo frame as a Home Assistant dashboard. The idea is to have a device that is always on and always connected to the Home Assistant server, so you can have a quick look at the status of your home automation system.

Results

Here's a photo of the Nexfoto frame running Fully Kiosk Browser with Home Assistant:

Nexfoto frame running Fully Kiosk Browser with Home Assistant

@msurguy
msurguy / Ajax-Instructions.md
Created April 4, 2014 22:52
Morris bar charts with AJAX (Laravel)

Did I hear you wanted AJAX charts instead of hard coded? You got it.

Follow this guide to integrate bar chart reports into your Laravel application with AJAX. Reports like the following come with this guide:

  • Total number of Orders by day
  • Total number of Users subscribed by day
  • etc

The library used for the charts is: http://www.oesmith.co.uk/morris.js/

@msurguy
msurguy / PowerShellProfile.ps1
Created March 18, 2023 06:23
FFMPEG commands for stitching Blender videos
function stitch($inputPrefix, $outputFile, $crf = 18) {
if (-not $inputPrefix) {
Write-Error "Input prefix must be specified."
return
}
$cmd = "ffmpeg -r 30 -i ${inputPrefix}%04d.png -c:v libx264 -crf $crf -pix_fmt yuv420p -f mp4 $outputFile.mp4"
Invoke-Expression $cmd
}
#!/bin/sh
# ------------------------------------------------------------------------------
# Uses FFmpeg to create an H.264 encoded MPEG-4 movie at 30 fps from
# an image sequence; filesize/quality can be tuned with the second parameter.
#
# ------------------------------------------------------------------------------
# Usage:
# > sh makemovie.sh imageFolder 20
# - imageFolder is a folder containing the images
# - 20 is an optional constant rate factor value,
@msurguy
msurguy / readme.md
Last active June 4, 2022 16:28
installing psmoveapi on raspberry pi zero
git clone https://github.com/thp/psmoveapi.git --recursive
sudo apt-get update -y
cd psmoveapi/
mkdir build
cd build
cmake .. -DPSMOVE_BUILD_CSHARP_BINDINGS:BOOL=OFF -DPSMOVE_BUILD_EXAMPLES:BOOL=ON  -DPSMOVE_BUILD_JAVA_BINDINGS:BOOL=OFF -DPSMOVE_BUILD_OPENGL_EXAMPLES:BOOL=OFF -DPSMOVE_BUILD_PROCESSING_BINDINGS:BOOL=OFF -DPSMOVE_BUILD_TESTS:BOOL=OFF -DPSMOVE_BUILD_TRACKER:BOOL=OFF -DPSMOVE_USE_PSEYE:BOOL=OFF
make
sudo cp {psmove.py,_psmove.so} /usr/lib/python3.5
@msurguy
msurguy / rafParallax.js
Created April 15, 2015 18:26
parallax via requestAnimationFrame
var $content = $('header .content')
, $blur = $('header .overlay')
, wHeight = $(window).height();
$(window).on('resize', function(){
wHeight = $(window).height();
});
/**
* requestAnimationFrame Shim
@msurguy
msurguy / eloquent.md
Last active February 8, 2022 03:13
Laravel 4 Eloquent Cheat Sheet.

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

@msurguy
msurguy / SVG Save.json
Created January 31, 2022 05:56
SVG Save
{
"export_version": "0.10",
"framed_nodes": {},
"groups": {},
"metainfo": {
"author": "",
"description": "",
"keywords": "",
"license": "CC-BY-SA"
},