Skip to content

Instantly share code, notes, and snippets.

@Paul-frc
Paul-frc / flex-for-ie-10-and-safari.css
Last active October 1, 2021 09:07
the flexbox equiv. for IE10
/* ==================== */
/* container attributes */
/* ==================== */
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-direction: row | column | row-reverse | column-reverse;
-webkit-flex-direction: row | column | row-reverse | column-reverse;
@frosit
frosit / infectedFiles.md
Created May 5, 2016 22:40
Some commands for finding and clearing infected PHP files

Finding infected files with following bash commands

** Command to list all infected files:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot
  • grep -lr --include=*.php "eval" .
  • grep -lr --include=*.php "base64" .

Command to remove malicious code:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot | xargs sed -i.bak 's/<?php eval(base64_decode[^;]*;/<?php\n/g'
@mowings
mowings / readme.md
Last active April 9, 2024 20:51
ffmpeg stream and save video from Dahua 4300s IP Camera

Use ffmpeg to stream video from a dahua 4300s to a file or files

You can use ffmpeg to directly pull frames off of a dahua 4300s at full resolution. May be a good alternative to pricey dvrs which likely cannot record at full resolution, may not work with the camera, or are prohibitevly expensive

Simple Stream to file

Simple stream to file. Full resolution

ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:admin@198.175.207.61:554/live" \

-c copy -map 0 foo.mp4

@jlem
jlem / ApplicationsServiceProvider.php
Created August 21, 2015 14:35
Laravel 5 App Skeleton
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Request;
use View;
use App;
abstract class ApplicationsServiceProvider extends ServiceProvider
{
public function register()
@mandiwise
mandiwise / Update remote repo
Last active April 17, 2024 07:41
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@andrewrcollins
andrewrcollins / mix_tint_tone_shade.php
Last active February 24, 2024 18:52
Color Mixing, Tint, Tone, and Shade in PHP
<?php
/**
* mix
*
* @param mixed $color_1
* @param mixed $color_2
* @param mixed $weight
*
* @return void
@geeknam
geeknam / git_history.php
Created May 8, 2011 16:43
Parse git log with PHP to an array
<?php
// Author: Ngo Minh Nam
$dir = "/path/to/your/repo/";
$output = array();
chdir($dir);
exec("git log",$output);
$history = array();
foreach($output as $line){
if(strpos($line, 'commit')===0){