Skip to content

Instantly share code, notes, and snippets.

View mstfydmr's full-sized avatar
🚀
Focusing

Mustafa Aydemir mstfydmr

🚀
Focusing
View GitHub Profile
@franzenzenhofer
franzenzenhofer / minimal-user-interaction.js
Last active December 18, 2024 13:37
minimal-user-interaction Google Tag Manager Tag
<script>
var mui = function()
{
var fired = false;
var kickTrigger = function()
{
if(fired === true){return false;}
//console.log("miniumal-user-interaction");
dataLayer.push({'minimal-user-interaction': true});
@Salah856
Salah856 / Controllers--Livewire--Chat.php
Created June 19, 2020 09:18 — forked from developerdza/Controllers--Livewire--Chat.php
Real Time Chat By Laravel And Livewire
<?php
namespace App\Http\Livewire\Forum;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Livewire\WithPagination;
use Livewire\Component;
use App\Message;
use App\User;
class Chat extends Component
@tomsihap
tomsihap / gist:e703b9b063ecc101f5a4fc0b01a514c9
Created December 23, 2018 14:46
Install NVM in Ubuntu 18.04 with ZSH
# Find the latest version on https://github.com/creationix/nvm#install-script
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# Add in your ~/.zshrc the following:
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
$ source ~/.zshrc
@mstfydmr
mstfydmr / migrate-django.md
Last active October 24, 2018 06:07 — forked from sirodoht/migrate-django.md
How to migrate Django from SQLite to MySQL

How to migrate Django from SQLite to MySQL

Dump existing data:

python3 manage.py dumpdata > datadump.json

Change settings.py to Postgres backend.

Make sure you can connect on MySQL. Then:

@pecuchet
pecuchet / laravel-guzzle-response-cache.php
Last active November 24, 2021 11:46
Simple Laravel 5.5 + Guzzle 6 cache middleware. This is now a composer package: https://github.com/brightfish-be/caching-guzzle.
<?php namespace App\Clients\Middleware;
use GuzzleHttp\Psr7\Response;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\Promise\FulfilledPromise;
use Illuminate\Contracts\Cache\Repository;
/**
@ipepe
ipepe / install-chrome-headless.sh
Last active February 10, 2025 16:14
Installing headless chrome on Ubuntu.
#!/bin/bash
# from https://chromium.woolyss.com/
# and https://gist.github.com/addyosmani/5336747
# and https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:canonical-chromium-builds/stage
sudo apt-get update
sudo apt-get install chromium-browser
chromium-browser --headless --no-sandbox http://example.org/
@brandonbarringer
brandonbarringer / industries.txt
Created December 30, 2016 20:31
List of Industries
Accounting
Airlines/Aviation
Alternative Dispute Resolution
Alternative Medicine
Animation
Apparel & Fashion
Architecture & Planning
Arts & Crafts
Automotive
Aviation & Aerospace
@cahna
cahna / parse_ps_aux.py
Last active December 6, 2024 12:26
Parse the output of `ps aux` into a list of dictionaries representing the parsed process information from each row of the output.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pprint
import subprocess
def get_processes():
"""
Parse the output of `ps aux` into a list of dictionaries representing the parsed
@leepro
leepro / bytes.py
Created March 21, 2014 19:43
Human readable bytes conversions
## {{{ http://code.activestate.com/recipes/578019/ (r15)
#!/usr/bin/env python
"""
Bytes-to-human / human-to-bytes converter.
Based on: http://goo.gl/kTQMs
Working with Python 2.x and 3.x.
Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com>
License: MIT
@pbojinov
pbojinov / jquery.document.ready.js
Last active August 30, 2018 10:56
document ready extracted from jQuery source
/**
* Minified version
* 1.14KB (377 bytes gzipped)
*
* (function(){var documentIsReady=false;function documentReadyHandler(fn){if(!documentIsReady){documentIsReady=true;if(document.addEventListener)document.removeEventListener("DOMContentLoaded",function(){documentReadyHandler(fn)},false);else if(document.attachEvent)if(document.readyState=="complete")document.detachEvent("onreadystatechange",function(){documentReadyHandler(fn)});fn()}}function documentReady(fn){if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){documentReadyHandler(fn)},false);window.addEventListener("load",function(){documentReadyHandler(fn)},false)}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){documentReadyHandler(fn)});window.attachEvent("onload",function(){documentReadyHandler(fn)});var toplevel=false;try{toplevel=window.frameElement==null}catch(e){}if(document.documentElement.doScroll&&toplevel)doScrollCheck(function(){documentReadyHandler(fn)})}}function doSc