Skip to content

Instantly share code, notes, and snippets.

View ciruz's full-sized avatar
🔥
on fire

Tom ciruz

🔥
on fire
View GitHub Profile
@reecelucas
reecelucas / useScrollBlock.js
Last active July 18, 2024 15:01
React hook to enable/disable page scroll
import { useRef } from 'react';
const safeDocument = typeof document !== 'undefined' ? document : {};
/**
* Usage:
* const [blockScroll, allowScroll] = useScrollBlock();
*/
export default () => {
const scrollBlocked = useRef();
@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active July 14, 2024 18:01
Front-end frameworks popularity (React, Vue, Angular and Svelte)
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Todo;
class TodosController extends Controller
{
@parmentf
parmentf / GitCommitEmoji.md
Last active July 23, 2024 11:27
Git Commit message Emoji
@nunoveloso
nunoveloso / nuno_php_array_ops.php
Created March 7, 2012 12:34
PHP array operations up to 10x faster than the original
/**
* Home mande method to do array_diff ~10x faster that PHP built-in.
*
* @param The array to compare from
* @param An array to compare against
*
* @return an array containing all the entries from array1 that are not present in array2.
*/
function nuno_array_diff($array1, $array2) {
$diff = array();