Skip to content

Instantly share code, notes, and snippets.

View hgouveia's full-sized avatar

Jose De Gouveia hgouveia

View GitHub Profile
@jonathanxie
jonathanxie / server.js
Last active November 10, 2017 03:28
Updated server.js for LoopBack to handle HTTP to HTTPS redirects
var loopback = require('loopback');
var boot = require('loopback-boot');
// Load the necessary modules and middleware for HTTPS
var http = require('http');
var https = require('https');
var httpsRedirect = require('./middleware/https-redirect');
var sslCert = require('./ssl/ssl-cert');
var httpsOptions = {
key: sslCert.privateKey,
@falkolab
falkolab / download.js
Created July 30, 2014 08:16
Download file by http with progress (NodeJS)
function download(fileUrl, apiPath, callback) {
var url = require('url'),
http = require('http'),
p = url.parse(fileUrl),
timeout = 10000;
var file = fs.createWriteStream(apiPath);
var timeout_wrapper = function( req ) {
return function() {
@xombra
xombra / bancos
Last active May 30, 2023 18:16
Codigo y Bancos correspondientes de Venezuela
Banco:
<select name="banco">
<option value=""></option>
<option value="0156">100%BANCO</option>
<option value="0196">ABN AMRO BANK</option>
<option value="0172">BANCAMIGA BANCO MICROFINANCIERO, C.A.</option>
<option value="0171">BANCO ACTIVO BANCO COMERCIAL, C.A.</option>
<option value="0166">BANCO AGRICOLA</option>
<option value="0175">BANCO BICENTENARIO</option>
<option value="0128">BANCO CARONI, C.A. BANCO UNIVERSAL</option>
@ranacseruet
ranacseruet / VideoStream.php
Last active May 26, 2024 20:40
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
@baderj
baderj / twitch_past_broadcast_downloader.py
Last active March 5, 2023 21:43
script to download past broadcasts from twitch.tv
import requests
import sys
import json
import re
import os
import string
import argparse
BASE_URL = 'https://api.twitch.tv'
@kmark
kmark / plexDownloadMulti.sh
Created September 24, 2013 01:12
Super simple bash script to repeatedly execute plexDownload.php with the same encoding settings but different media IDs. Great for TV show seasons.
#!/bin/bash
# Copyright 2013 Kevin Mark
# Licensed under the Apache License, Version 2.0
# Will expand upon this script to be more convient, proof of concept right now.
# EXAMPLE USAGE: ./plexDownloadMulti.sh "-h 127.0.0.1:32400 -r 720x480 -b 800" 123 456 789
# Universal encoding settings in quotes is the first param. Space-seperated mediaIds are the rest
# Change the "folderformedia" and make sure it exists. Change the extension too if you want.
@ivamluz
ivamluz / twitter4j-find-replies.java
Last active June 6, 2023 16:22
Code snippet showing how to post a reply to a tweet using twitter4j library
public static List<Status> findReplies() {
Query query = new Query("iluzcit");
List<Status> tweets = new ArrayList<Status>();
Twitter twitter = new TwitterFactory().getInstance();
try {
QueryResult result;
do {
result = twitter.search(query);
@kmark
kmark / plexDownload.php
Last active May 17, 2024 02:08
The Plex Universal Transcoder Downloader mimics the actions of the Plex/Web media flash player to download transcoded media. The differences begin when the downloader saves the streamed data and pieces it together. First a start.m3u8 playlist file is requested from the server with a query string that defines the transcoding options. Inside the …
<?php
/*******************************************************************************
* Plex Universal Transcoder Downloader v1.3 *
* See --help or --usage for more info *
*******************************************************************************
* Copyright 2013 Kevin Mark *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
@MobiDevelop
MobiDevelop / ArchiveFileHandle.java
Created May 3, 2013 21:28
A ZipFile-based FileHandle implementation for LibGDX.
package com.mobidevelop.gdx.examples;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import com.badlogic.gdx.Files.FileType;
import com.badlogic.gdx.files.FileHandle;
@jirutka
jirutka / analytics.conf
Created March 31, 2013 01:03
Add Google Analytics tracking code to HTML via nginx
#
# Add Google Analytics tracking code to HTML response
#
# Usage:
# set $tracking_id 'UA-12345678-9';
# include incl/analytics.conf;
#
# It needs nginx compiled with option --with-http_sub_module.
# Uses optimized GA code from: http://mathiasbynens.be/notes/async-analytics-snippet
#