Skip to content

Instantly share code, notes, and snippets.

View cosmomathieu's full-sized avatar
🎯
Focusing

Cosmo Mathieu cosmomathieu

🎯
Focusing
View GitHub Profile
@tatsuyasusukida
tatsuyasusukida / !README-javascript-media-video.md
Last active May 9, 2024 02:01
🎥 How to record a video with JavaScript [demo video available]

🎥 How to record a video with JavaScript [demo video available]

Demo video: How to record a video with JavaScript

About this article

This article describes how to shoot a video from JavaScript using the MediaStream Recording API. The related resources are shown below.

@juliyvchirkov
juliyvchirkov / string.polyfill.php
Last active April 14, 2024 22:24
php: polyfills of string functions str_starts_with, str_contains and str_ends_with
<?php declare(strict_types = 1);
/**
* Provides polyfills of string functions str_starts_with, str_contains and str_ends_with,
* core functions since PHP 8, along with their multibyte implementations mb_str_starts_with,
* mb_str_contains and mb_str_ends_with
*
* Covers PHP 4 - PHP 7, safe to utilize with PHP 8
*/
/**
@bryant988
bryant988 / zillow.js
Last active May 3, 2024 15:23
Zillow Image Downloader
/**
* NOTE: this specifically works if the house is for sale since it renders differently.
* This will download the highest resolution available per image.
*/
/**
* STEP 1: Make sure to *SCROLL* through all images so they appear on DOM.
* No need to click any images.
@cosmomathieu
cosmomathieu / FileManager.php
Last active April 8, 2023 02:58
Using FlySystem with Digital Oceans Spaces
<?php
class FileManager
{
const USER_FOLDER = siteData()->userFolder;
protected $adapter;
public function __construct($adapter)
{
@aondio
aondio / ova-to-box.md
Created April 8, 2019 15:09
Convert VirtualBox .ova to Vagrant box

Here's a step by step guide to convert a Virtualbox .ova to a Vagrant box.

  1. List your VMs to find the VM id you want to convert:
$ VBoxManage list vms
"testing" {a3f59eed-b9c5-4a5f-9977-187f8eb8c4d4}
  1. You can now package the .ova VM as Vagrant box:
<?php
$file = $file['temp']['file'];
$image = new Image($file);
$image->save(${filename}, [optional]${quality}); // Use this when moving a file from one location to another. Especially in the case when we upload a file to the server.
$image->resize(${width}, ${height}, [optional]${crop}, [optional]${replace});
$image->createThumb(${width}, ${height}, [optional] ${save_path});
$image->getWidth();
$image->getHeight();
@robertbrodrecht
robertbrodrecht / grid.html
Last active April 26, 2021 23:39
Simple CSS Grid Framework
<div class="row">
<div class="column column--6"></div>
<div class="column column--6"></div>
</div>
<div class="row">
<div class="column column--4"></div>
<div class="column column--4"></div>
<div class="column column--4"></div>
</div>
<div class="row">
@cosmomathieu
cosmomathieu / jquery.background-image-scroll-effects.js
Last active April 8, 2023 03:08
A lightweight jQuery plugin to animate background images on scroll; fade, zoom, and blur.
/**
* jQuery plugin for adding hero image background animation
*
* Zooms, blurs, and fades background image on scroll down.
*
* @author Cosmo Mathieu <cosmo@cosmointeractive.co>
*/
// jquery-ps-background-animate.js
/*!
@sedflix
sedflix / download-unzip.php
Last active August 21, 2018 15:59 — forked from philipp-r/download-unzip.php
Download and unzip file with PHP
<?php
// get latest german WordPress file
$ch = curl_init();
$source = "https://github.com/geekSiddharth/student-senate/archive/master.zip"; // THE FILE URL
curl_setopt($ch, CURLOPT_URL, $source);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec ($ch);
curl_close ($ch);
@braginteractive
braginteractive / functions.php
Created April 14, 2017 15:40
Twenty Seventeen Child WordPress Theme
<?php
function my_theme_enqueue_styles() {
$parent_style = 'twentyseventeen-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')