Skip to content

Instantly share code, notes, and snippets.

View cethap's full-sized avatar

Cesar tapasco cethap

  • Arcaris Labs
  • Cali, Colombia
View GitHub Profile
This file has been truncated, but you can view the full file.
{"traceEvents":[{"pid":9264,"tid":1348,"ts":76934124438,"ph":"X","cat":"toplevel","name":"MessageLoop::RunTask","args":{"src_file":"../../mojo/public/cpp/system/simple_watcher.cc","src_func":"Notify"},"dur":64},
{"pid":9264,"tid":1348,"ts":76934125517,"ph":"X","cat":"toplevel","name":"MessageLoop::RunTask","args":{"src_file":"../../mojo/public/cpp/system/simple_watcher.cc","src_func":"Notify"},"dur":184},
{"pid":9264,"tid":1348,"ts":76934125539,"ph":"X","cat":"ipc,toplevel","name":"ChannelMojo::OnMessageReceived","args":{"class":6,"line":77},"dur":147},
{"pid":9264,"tid":1348,"ts":76934129511,"ph":"X","cat":"toplevel","name":"MessageLoop::RunTask","args":{"src_file":"../../content/browser/renderer_host/render_view_host_impl.cc","src_func":"RenderWidgetWillSetIsLoading"},"dur":15},
{"pid":9264,"tid":1348,"ts":76934129540,"ph":"X","cat":"toplevel","name":"MessageLoop::RunTask","args":{"src_file":"../../ipc/ipc_channel_proxy.cc","src_func":"Send"},"dur":45},
{"pid":9264,"tid":1348,"ts":76934129958,"ph":"X","cat"
@cethap
cethap / launch-grid.sh
Created October 18, 2016 21:09 — forked from revington/launch-grid.sh
launch selenium grid + phantomjs
#!/usr/bin/env sh
trap 'killall' INT
killall() {
trap '' INT TERM # ignore INT and TERM while shutting down
echo "**** Shutting down... ****" # added double quotes
kill -TERM 0 # fixed order, send TERM not INT
wait
echo DONE
}
@cethap
cethap / redirects.js
Created September 30, 2016 02:43
Phantomjs redirects handling
function renderPage(url) {
var page = require('webpage').create();
var redirectURL = null;
page.onResourceReceived = function(resource) {
if (url == resource.url && resource.redirectURL) {
redirectURL = resource.redirectURL;
}
};
@cethap
cethap / server.js
Created September 2, 2016 02:41 — forked from bellbind/server.js
[nodejs][linux][ffmpeg][chrome][html5]live streaming example on linux
var http = require("http");
var cp = require("child_process");
// live streaming example on linux (for chrome, not for firefox)
// for ubuntu, required libavcodec-extra-53 instead of libavcode53
// for ffmpeg command
// see: http://granular.cs.umu.se/browserphysics/?p=2287
var server = http.createServer(function (req, res) {
console.log(req.url);
@cethap
cethap / percentile.js
Created August 26, 2016 21:40 — forked from IceCreamYou/percentile.js
Utility functions to calculate percentiles and percent ranks in a JavaScript array.
// Returns the value at a given percentile in a sorted numeric array.
// "Linear interpolation between closest ranks" method
function percentile(arr, p) {
if (arr.length === 0) return 0;
if (typeof p !== 'number') throw new TypeError('p must be a number');
if (p <= 0) return arr[0];
if (p >= 1) return arr[arr.length - 1];
var index = arr.length * p,
lower = Math.floor(index),
@cethap
cethap / 01 bluetooth webapp
Created December 29, 2015 22:41 — forked from Cinezaster/01 bluetooth webapp
Node.js Bluetooth integrated web-app
This a bluetooth web-app.
<?php
/**
* NLSClientScript v6.21
*
* a single-file Yii CClientScript extension for
* - preventing multiple loading of javascript files
* - merging, caching registered javascript and css files
*
* The extension is based on the great idea of Eirik Hoem, see
* http://www.eirikhoem.net/blog/2011/08/29/yii-framework-preventing-duplicate-jscss-includes-for-ajax-requests/
browser.actions().mouseMove(element(by.css('#myElement'))).perform();
browser.actions().click(protractor.Button.RIGHT).perform();
var myString = (function () {/*
<div id="someId">
some content<br />
<a href="#someRef">someRefTxt</a>
</div>
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1];
@cethap
cethap / Camerajs_WP
Last active August 29, 2015 14:04
wordpress
<?php
/**
* SlideCamerajs
*/
function SlideCamerajs($attr) {
$attr = shortcode_atts(
array(
'height' => '320',