Skip to content

Instantly share code, notes, and snippets.

View webdevsuperfast's full-sized avatar
🏠
Working from home

Rotsen Mark Acob webdevsuperfast

🏠
Working from home
View GitHub Profile
@webdevsuperfast
webdevsuperfast / README.md
Created September 27, 2018 23:55 — forked from eddywashere/README.md
Load third party javascript asynchronously, initialize queue for method calls, replace queue function, profit?

live demo

Files:

  • index.html: example of queue (the part that is always shown)
  • third-party.js: example of third party javascript (the part no one ever talks about)

Inspiration:

  • google analytics
@webdevsuperfast
webdevsuperfast / ffmpeg_mkv_mp4_conversion.md
Created August 31, 2018 00:11 — forked from jamesmacwhite/ffmpeg_mkv_mp4_conversion.md
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@webdevsuperfast
webdevsuperfast / jquery.script.js
Created April 27, 2018 04:13 — forked from solepixel/jquery.script.js
Vertically and horizontally center Soliloquy slides while still keeping proportions. Emulating the "background-size: cover" with a standard slider. Slider configuration looks like this: Slider Dimensions: Full Width, Slider Position: Center, Use Adaptive Height: Yes, Crop Images in Slider: Yes
(function( $ ){
'use strict';
function auto_fit_soliloquy( parent_selector ){
// resize the slider container
var $soliloquy = $( parent_selector + ' .soliloquy-container'),
$all_items = $('.soliloquy-slider,.soliloquy-viewport,.soliloquy-item', $soliloquy ),
$container = $('.soliloquy-item', $soliloquy ),
window_height = $(window).height();
#!/bin/sh
# credit from http://stackoverflow.com/questions/6301885/convert-tar-gz-to-zip
for f in *.tar.gz
do
rm -rf ${f%.tar.gz}
mkdir ${f%.tar.gz}
tar xvzf $f -C ${f%.tar.gz}
zip ${f%.tar.gz}.zip -r ${f%.tar.gz}
rm -rf ${f%.tar.gz}
@webdevsuperfast
webdevsuperfast / soliloquy_wordpress_native_responsive.php
Created January 16, 2018 23:26 — forked from scotthorn/soliloquy_wordpress_native_responsive.php
Make Soliloquy use the native responsive image handling from Wordpress 4.4+
<?php
// Make Soliloquy sliders use wp's native responsive images with wp retina
function my_theme_soliloquy_output($slider, $data) {
return wp_make_content_images_responsive($slider);
}
add_filter('soliloquy_output', 'my_theme_soliloquy_output', 10, 2);
// wp_make_content_images_responsive needs the img tags to have a class with their id
function my_theme_soliloquy_image_slide_class($classes, $item, $i, $data, $mobile) {
$classes[] = 'wp-image-' . $item['id'];
@webdevsuperfast
webdevsuperfast / .gitmodules
Created December 29, 2017 00:25 — forked from westonruter/.gitmodules
Test widget plugin for WordPress issue #27491: Widget Customizer: Dynamically-created inputs cause from to replace itself without event to trigger re-initialization https://core.trac.wordpress.org/ticket/27491
[submodule "chosen"]
path = chosen
url = git@github.com:harvesthq/chosen.git
@webdevsuperfast
webdevsuperfast / webpack.config.js
Created December 19, 2017 08:38 — forked from allysonsouza/webpack.config.js
WebPack for WordPress Theme
// Const
const webpack = require('webpack'); //to access built-in plugins
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require('path');
// ExtractPlugin - Multiple instances
// Configure individual stylesheet generation to use correctly with wp_enqueue_style
const extractMain = new ExtractTextPlugin('css/main.min.css');
const extractAdmin = new ExtractTextPlugin('css/admin.min.css');
const extractEditor = new ExtractTextPlugin('css/editor.min.css');
@webdevsuperfast
webdevsuperfast / ajax.php
Created December 1, 2017 05:09 — forked from sniperwolf/ajax.php
Super-Simple WordPress ajax post-popup with jQuery and Reveal plugin
<?php
/**
* Template Name: ajax
*/
?>
<?php
$post = get_post($_GET['id']);
?>
<?php if ($post) : ?>
<?php setup_postdata($post); ?>
@webdevsuperfast
webdevsuperfast / vc_custom_icon_set.php
Created November 12, 2017 06:10 — forked from zecka/vc_custom_icon_set.php
Add a custom icon set from icomoon to visual composer vc_icon shortcode
<?php
// Add new custom font to Font Family selection in icon box module
function zeckart_add_new_icon_set_to_iconbox( ) {
$param = WPBMap::getParam( 'vc_icon', 'type' );
$param['value'][__( 'IcoMoon', 'total' )] = 'icomoon';
vc_update_shortcode_param( 'vc_icon', $param );
}
add_filter( 'init', 'zeckart_add_new_icon_set_to_iconbox', 40 );
@webdevsuperfast
webdevsuperfast / google-dorks
Created November 10, 2017 22:48 — forked from clarketm/google-dorks
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!