Skip to content

Instantly share code, notes, and snippets.

View tzkmx's full-sized avatar
🎉
estrenando repositorios privados

Jesus Franco tzkmx

🎉
estrenando repositorios privados
View GitHub Profile
@Integralist
Integralist / 1. elements.html
Created November 20, 2012 08:41
The Checkbox CSS Hack (doesn't work in IE <= 8, but all other browsers fine)
<label for="toggle-1">I'm a toggle</label>
<input type="checkbox" id="toggle-1">
<div>I'm controlled by toggle. No JavaScript!</div>
@derpixler
derpixler / wp-hooks-filter.php
Created October 4, 2011 08:37 — forked from bueltge/wp-hooks-filter.php
Instruments Hooks for a Page of WordPress. Outputs during the Shutdown Hook after add get-params: ?instrument=hooks
<?php
/*
Plugin Name: Instrument Hooks for WordPress
Plugin URI: http://bueltge.de/
Description: Instruments Hooks for a Page. Outputs during the Shutdown Hook after add get-params <code>?instrument=hooks</code>.
Version: 0.0.1
Author: Frank B&uuml;ltge
Author URI: http://bueltge.de/
*/
@giacomopaita
giacomopaita / Lazy Load FB Like
Last active February 18, 2017 00:02
Lazy Load Facebook Like Box
$('.tab a').on('click', function(){
if ($(this).html() == 'FACEBOOK' && typeof xx == 'undefined') {
// DUMMY VARIABLE TO CALL THE FUNCTION ONLY THE FIRST TIME THE USER CLICKS THE TAB:
xx = 1;
(function(d, s, id) {
var js;
var fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
@hSATAC
hSATAC / .vimrc
Created December 19, 2011 09:05
runtime php syntax check without saving file
set errorformat=%m\ in\ %f\ on\ line\ %l
if !exists('*PHPsynCHK')
function! PHPsynCHK()
ccl
let winnum = winnr()
let linenum = line('.')
let colnum = col('.')
silent execute "%!php -l -f /dev/stdin | sed 's/\\/dev\\/stdin/".bufname("%")."/g' >.vimerr; cat"
silent cf .vimerr
cw
@jreinke
jreinke / generate.php
Created August 14, 2012 14:45
Default password encoding in Silex micro-framework
<?php
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
$encoder = new MessageDigestPasswordEncoder();
echo $encoder->encodePassword('foo', '');
// 5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg==
@yoren
yoren / 1fix-switch-theme-on-certain-pages.php
Created August 10, 2016 08:27
WordPress tiny plugin - Switch theme on certain pages
<?php
/**
* @package One_Fix_Switch_Theme
* @version 1.0
*/
/*
Plugin Name: One Fix Switch Theme
Plugin URI: https://www.1fix.io
Description: Switch theme on certain pages.
Author: Yoren Chang
@dgkanatsios
dgkanatsios / sentimentanalysisgreek.js
Last active April 21, 2018 20:12
Sentiment analysis via Azure Text Analytics API
const request = require('request');
const fs = require('fs');
const url = 'https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment';
const textanalyticskey = '<YOUR_TEXT_ANALYTICS_KEY>';
const data = JSON.parse(fs.readFileSync('test.json', 'utf8'));
request.post(url,
{
@nez
nez / gist:773260e6553b3f3cea9b
Created October 16, 2015 20:49
Clojure para bobos
Para instalar lein: leiningen.org
Para probar desde internet: tryclj.com
doc source
defn fn def #()
aridades multiples
& apply
@x1wins
x1wins / encoding_h264.sh
Last active April 16, 2019 22:10
FFMpeg convert ts to hls
#!/usr/bin/env bash
set -e
# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1
source="${1}"
target="${2}"
command="ffmpeg -hide_banner -y -i ${1} \
-vf scale=w=640:h=360 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -hls_segment_filename ${target}/360p_%03d.ts ${target}/360p.m3u8 \
-vf scale=w=842:h=480 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 1400k -maxrate 1498k -bufsize 2100k -b:a 128k -hls_segment_filename ${target}/480p_%03d.ts ${target}/480p.m3u8 \
-vf scale=w=1280:h=720 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 2800k -maxrate 2996k -bufsize 4200k -b:a 128k -hls_segment_filename ${target}/720p_%03d.ts ${tar
@javierarques
javierarques / gist:8304351
Created January 7, 2014 18:43
[WP] Create post with Contact Form 7 post data via wpcf7_before_send_mail hook
add_action('wpcf7_before_send_mail', 'cf7_create_post', 10, 1);
function cf7_create_post( $data ) {
extract($data->posted_data);
$post_id = wp_insert_post( array(
'post_status' => 'draft',
'post_title' => $nombre,
'post_content' => $consulta