Skip to content

Instantly share code, notes, and snippets.

View wemersonblend's full-sized avatar

Wemerson Silva wemersonblend

View GitHub Profile
@wemersonblend
wemersonblend / gist:b2881bf43036094257a3776bc83d1fdc
Created October 31, 2018 18:07 — forked from mhawksey/gist:1442370
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@wemersonblend
wemersonblend / broken-package.sh
Last active May 24, 2018 17:47
Reconfigure broken installed dependences
$ dpkg -l | grep ^i[HUFW]
iU <broken-package> 2.7.3-0ubuntu2.2 Pakage Description (default version)
$ apt-cache depends <broken-package>
python2.7-minimal (EXAMPLE)
Depends: libpython2.7-minimal
Depends: zlib1g
PreDepends: libc6
Suggests: binfmt-support
binfmt-support:i386
Recommends: python2.7
@wemersonblend
wemersonblend / concat.sh
Created October 11, 2016 00:27
Bash script to concatenate videos horizontally
#!/bin/bash
args=("$@")
curr=
width=0
overlay=0
total_width=`mediainfo '--Inform=Video;%Width%' $1`
outs[0]=$1
<?php
libxml_use_internal_errors(true);
$file = "rss.player.18.xml";
$xml = simplexml_load_string($file, null, LIBXML_NOCDATA);
# Criando backup do seu perfil de usuário
mv ~/.config/google-chrome/Default ~/.config/google-chrome/Default_bkp
#Recriando um novo diretório aonde o seu perfil será criado
mkdir ~/.config/google-chrome/Default
#Copiando os favoritos para a sua nova pasta de perfil
cp ~/.config/google-chrome/Default_bkp/Bookmarks ~/.config/google-chrome/Default/Bookmarks
#Abrindo o Google Chrome com as novas configurações
cp -r `ls -A | grep -v "folderToExclude"` /tmp
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
'use strict';
function ObjectProtoOfArray ( ){
var _this;
var indexActive = 0;
ToArray.prototype = {
add : function(obj, isArray) {