Skip to content

Instantly share code, notes, and snippets.

View TeddyBear06's full-sized avatar
:octocat:

T3d TeddyBear06

:octocat:
View GitHub Profile
@TeddyBear06
TeddyBear06 / README.md
Last active March 1, 2022 22:20
Fix apt issues on Ubuntu 20.04 under WSL2

Fix apt-get update on Ubuntu 20.04 under WSL2

I recently cannot run a apt-get update resulting in a kind of - weird - temporary network issue...

Execute the following lines to adress this issue:

wget https://gist.githubusercontent.com/TeddyBear06/f2524b8b2d0e15336c4f8463127f5332/raw/cc54c875310d7be4e768bf6c50df496ac4294cbb/fix_apt_update_under_WSL.sh
chmod +x fix_apt_update_under_WSL.sh
sudo ./fix_apt_update_under_WSL.sh
@TeddyBear06
TeddyBear06 / gist:cedae273d0c968ae6b14cb04bae4fd64
Last active January 30, 2022 16:35
GitLab Docker installation

🎇 GitLab and GitLab runner using Docker 🎇

⚠️ There are known issues running GitLab/GitLab runner using Docker on Windows, please use GNU/Linux or macOS ⚠️

ℹ️ Run the installation on a brand new host without any previous services running on ports 22, 80 nor 443 ℹ️

🐳 Tested using Docker Desktop 4.4.4 (73704).

A. Map custom domain

@manoj-nandakumar
manoj-nandakumar / gist:11beb90916dfbdc6af7a
Created February 20, 2016 09:35
Laravel 5.2 And JqueryUI's Autocomplete Plugin
//SearchController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Input;
@mottihoresh
mottihoresh / PusherWrapper.php
Last active November 17, 2019 20:09
Basic Pusher Integration with Laravel 5
<?php
/**
* Created by PhpStorm.
* User: mhoresh
* Date: 3/7/15
* Time: 4:15 PM
*/
namespace App\Services;
@miguel-perez
miguel-perez / readyExec.js
Last active January 29, 2023 18:04
How to add the ability to re-run $(document).ready() functions
/**
* Replace jQuery's $.fn.ready() function with a mod exec
*
* Sites that make heavy use of the $(document).ready function
* are generally incompatable with asynchrounous content. The
* the $.fn.ready function only runs once. This script replaces
* the ready function with a module execution controller that
* let's us register functions and execute all of the functions
* as we need them. This is useful after HTML gets injected on the
* page and we want to rebind functionally to the new content.
@xadhix-zz
xadhix-zz / Facebook Lookback Downloader
Created February 4, 2014 12:18
Extracts the HD video link from the Facebook lookback page.
var xLBD = {};
xLBD.c = function (){
xLBD.f = unescape(document.querySelector("[flashvars]").getAttribute("flashvars")).substring(7);
xLBD.f = JSON.parse(xLBD.f.substring(0, xLBD.f.lastIndexOf("}") + 1)).video_data[0].hd_src;
xLBD.a = "<div style='position:absolute;top:100px;height:300px;left:15%;background:#fff;border:10px solid #000;font-size:5em;padding:100px;'>Click <a download='lookback.mp4' href='"+xLBD.f+"'>here<\/a> to download your lookBack video.</div>";
document.body.innerHTML += xLBD.a;
}
if(document.readyState == "complete")
xLBD.c();
else window.onload = xLBD.c;
<?php
/*
Increase or decrease value in CakePHP with little footprint.
Add this to your AppModel.
Usage:
(in Controller)
$this->Model->increase('field_name', 1);
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@lisacatalano
lisacatalano / radiobutton.js
Created November 7, 2013 19:36
Radio Button Class for X-Editable
/**
Radio buttons list (modified from checklist)
Internally value stored as javascript array of values.
@class radiolist
@extends list
@final
@example
<a href="#" id="options" data-type="radiolist" data-pk="1" data-url="/post" data-original-title="Select option"></a>
<script>
@lukearmstrong
lukearmstrong / gist:5782028
Created June 14, 2013 14:01
Laravel 4 Pagination for a "Many to Many" relationship.
$company = \Company::find($companyId)
->with('users')
->first();
$users = $company->users()->paginate(10);