Skip to content

Instantly share code, notes, and snippets.

View luchaos's full-sized avatar

luchaos luchaos

View GitHub Profile
@fson
fson / refactoring.md
Created December 12, 2012 19:48 — forked from anonymous/README.md
Meanings of refactoring
  • Martin Fowler: "disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior"
  • Opionated developer: renaming source files
  • Minimalistic developer: removing source files
  • Badass developer: rewriting everything from scratch
  • Technical lead: calls it 'improving' instead, to avoid scaring the management
  • Project manager: fixing previous mistakes
  • Product manager: time when no new features get done
  • CEO: slacking
@Sellyme
Sellyme / AStats completed filter.user.js
Last active January 24, 2019 23:52
Removes all games from AStats Steam_Games.php under a specific filter (by default games that are not owned or started)
// ==UserScript==
// @name AStats completed filter
// @version 0.3.2
// @description Removes all games from AStats Steam_Games.php that are either owned, or have had at least 1 achievement earned
// @author Sellyme
// @downloadURL https://gist.github.com/Sellyme/1ca4092058480517f7c255c6555bfe24/raw/AStats%2520completed%2520filter.user.js
// @updateURL https://gist.github.com/Sellyme/1ca4092058480517f7c255c6555bfe24/raw/AStats%2520completed%2520filter.user.js
// @match http://astats.astats.nl/astats/Steam_Games.php*
// @match https://astats.astats.nl/astats/Steam_Games.php*
// @run-at document-end
@XueshiQiao
XueshiQiao / gource.sh
Last active November 10, 2019 15:56 — forked from cgoldberg/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
@alexfouche
alexfouche / photo_renomme_date
Last active January 4, 2020 17:27
Search all subfolders for photos/videos to rename from their Exif data. Also compress videos to 720height 3000kbps x264 mp4
#!/usr/bin/env bash
#set -x
# Search all subfolders for photos/videos to rename from their Exif data.
# Also compress videos to 720height 3000kbps x264 mp4 (which is roughly divide size by ten from my camera .mov files)
# https://gist.github.com/1923696
where=$1
test -z "$where" && where='.'
@VinceG
VinceG / Builder.php
Created October 19, 2016 14:16
Laravel support for replace into / insert ignore / insert on duplicate key update
<?php
namespace App\Library\Database\Query;
use Illuminate\Database\Query\Builder as QueryBuilder;
class Builder extends QueryBuilder
{
/**
* Insert a new record into the database.
@veganista
veganista / OpenCartValetDriver.php
Created October 3, 2016 08:30
Laravel Valet Driver - OpenCart 2.x
<?php
class OpenCartValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@nasrulhazim
nasrulhazim / 01.md
Last active October 23, 2023 07:19
Laravel Default API Login

Setup

Migration

Create new migration script:

php artisan make:migration add_api_token --table=users
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@jakebathman
jakebathman / logslaravel.sh
Created August 19, 2018 00:06
Tail Laravel logs and filter out the stack traces
tail -f -n 450 storage/logs/laravel*.log \
| grep -i -E \
"^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" \
--color
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers