Skip to content

Instantly share code, notes, and snippets.

@pksunkara
pksunkara / config
Last active July 25, 2024 15:53
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@SaltwaterC
SaltwaterC / .gitignore
Created March 27, 2012 12:31 — forked from necenzurat/cache.php
php cache curl
/cache/
@chrisguitarguy
chrisguitarguy / object-cache.php
Created October 29, 2012 00:40
WordPress object cache implementation using APC.
<?php
/**
* Plugin Name: APC Object Cache
* Description: An object cache implementation that uses APC.
* Author: Christopher Davis
* Author URI: http://christopherdavis.me
* Version: 0.1
*
* Based on Mark Jaquith's APC object cache
* http://txfx.net/wordpress-plugins/apc/
@larrybotha
larrybotha / A.markdown
Last active February 7, 2024 15:20
Fix SVGs not scaling in IE9, IE10, and IE11

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.

@danharper
danharper / background.js
Last active June 29, 2024 19:32
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@ranacseruet
ranacseruet / VideoStream.php
Last active June 17, 2024 11:54
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
@linxlunx
linxlunx / hovercard.go
Created August 2, 2015 15:51
Twitter User Hovercard Endpoint
package main
import (
"fmt"
"log"
"io/ioutil"
"net/http"
"encoding/json"
"regexp"
"strings"
@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

@saadtazi
saadtazi / README.md
Last active May 1, 2019 12:11
Phantomjs login + nodejs requests (after getting cookies)
  1. npm install

  2. To test that phantomjs works as expected: ./node_modules/.bin/phantomjs phantom-script.js USERNAME PASSWD

  3. Then run it from nodejs: node phantom.js (the username and password are hardcoded in this file for now...)

The phantom.js script just proves that it works, by checking the "username" in the top right corner of the Premier homepage.

Note that it still takes about 6 seconds for phantomjs to login into QA.

@bueltge
bueltge / wp-plugin-security-testing-cheatsheet.md
Created August 22, 2016 12:12
WordPress Plugin Security Testing Cheat Sheet

WordPress Plugin Security Testing Cheat Sheet

This cheat sheet was compiled by Dewhurst Security to record the knowledge gained when testing WordPress plugins for security issues for our clients. The security documentation provided by WordPress and found online for plugin security is sparse, outdated or unclear. This cheat sheet is intended for Penetration Testers who audit WordPress plugins or developers who wish to audit their own WordPress plugins.

This is a living document, feedback in the form of Issues or Pull Requests is very much welcomed.

Cross-Site Scripting (XSS)