Skip to content

Instantly share code, notes, and snippets.

View jrbenito's full-sized avatar

Josenivaldo Benito Junior jrbenito

View GitHub Profile
while [[ $# -gt 0 ]] && [[ ."$1" = .-* ]] ;
do
opt="$1";
shift; #expose next argument
case "$opt" in
"--" ) break 2;;
"-b" )
BRANCH_PATH="$1"; shift;;
"-branch" ) # alternate format
BRANCH_PATH="$1"; shift;;
@unnikked
unnikked / botscheduler.js
Last active July 24, 2021 00:29
Bot scheduler for Telegram - to use with IFTTT - please check https://unnikked.ga/build-telegram-bot-hook-io/ for instructions
module['exports'] = function bot (hook) {
var request = require('request');
var TOKEN = hook.env.bot_scheduler_token;
var ENDPOINT = 'https://api.telegram.org/bot' + TOKEN;
console.log(hook.params);
// generic handler to log api call responses
var handler = function (err, httpResponse, body) {
var response = JSON.stringify({
import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('image.jpg', cv2.IMREAD_GRAYSCALE)
def compute_skew(image):
image = cv2.bitwise_not(image)
height, width = image.shape
@jeffdonthemic
jeffdonthemic / index.js
Last active October 27, 2023 15:42
Lambda function to commit code to github. See blog post for more details.
var githubapi = require("github"),
async = require("async"),
AWS = require('aws-sdk'),
secrets = require('./secrets.js');
// the 'handler' that lambda calls to execute our code
exports.handler = function(event, context) {
// config the sdk with our credentials
// http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html
@KonradIT
KonradIT / readme.md
Last active September 25, 2023 01:55
GoPro Studio for Linux
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@mhawksey
mhawksey / gist:1442370
Last active February 25, 2024 12:01
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;
}