Skip to content

Instantly share code, notes, and snippets.

View xergiodf's full-sized avatar
🏠
Working from home

Sergio Fernández xergiodf

🏠
Working from home
View GitHub Profile
@xergiodf
xergiodf / crawler.php
Created September 10, 2011 00:25 — forked from crodas/crawler.php
Bancard's goodness
<?php
/**
* Abrir la página de pago del comercio, la URL sería similar a esto:
*
* https://www.bancard.com.py/webbancard/?MIval=/ECOM/pagina_pagos.html&clavecomercio_input=29165&nro_pedido_input=416404080
*
* $com = clavecomercio_input = 29165
* $end = nro_pedido_input = 416404080
*/
@xergiodf
xergiodf / README.md
Created June 16, 2017 17:34 — forked from sgomezglobant/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@xergiodf
xergiodf / wildfly-install.sh
Created October 9, 2017 00:43 — forked from sukharevd/wildfly-install.sh
Script to install JBoss Wildfly 10.x as service in Linux
#!/bin/bash
#title :wildfly-install.sh
#description :The script to install Wildfly 10.x
#more :http://sukharevd.net/wildfly-8-installation.html
#author :Dmitriy Sukharev
#date :2016-06-18T02:45-0700
#usage :/bin/bash wildfly-install.sh
#tested-version1 :10.0.0.CR3
#tested-distros1 :Ubuntu 15.10; Debian 7,8; CentOS 7; Fedora 22
#tested-version2 :10.0.0.Final
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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
http://www.apache.org/licenses/LICENSE-2.0
@xergiodf
xergiodf / ZipFiles.gs
Last active April 4, 2018 16:20
Create a zip file containing folders and files from Google Drive. I was trying to create a zip backup file of all files and folders inside Google Drive, but the result is having all the files converted to PDF (it's the way BLOB works inside Google Apps Scripts)
/**
* Returns an Array of Blobs based on the Folder
* @param reFolder - Google Folder type
* @param path
* @returns {Array}
* @private
*/
function __getBlobsPath(reFolder, path) {
var blobs = [];
var files = reFolder.getFiles();
@xergiodf
xergiodf / CopyFolder.gs
Created April 4, 2018 16:18
Functions to copy (backup) folders to a new destination. If there are too much files, the script fails.
/**
* Util function to copy one folder to another
* @param source
* @param target
* @private
*/
function __copyFolder(source, target) {
var folders = source.getFolders();
var files = source.getFiles();
@xergiodf
xergiodf / package.json
Created April 12, 2018 15:21 — forked from sethlopezme/package.json
Complete files for my article, Testing Hapi.js APIs. https://sethlopez.me/article/testing-hapi-js-apis
{
"name": "testing-hapi-js-apis",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"test": "ava --verbose test.js"
},
"dependencies": {
"ava": "^0.16.0",
"hapi": "^15.1.1"
@xergiodf
xergiodf / SimpleStore.js
Last active July 5, 2018 20:02 — forked from ksafranski/SimpleStore.js
Simple localStorage function with Cookie fallback for older browsers.
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve:
@xergiodf
xergiodf / README-Template.md
Created September 24, 2018 13:10 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@xergiodf
xergiodf / loginController.js
Created November 26, 2018 19:49
AngularJS Interceptor
(function () {
'use strict';
angular.module('some.module')
.controller('LoginController', loginController);
/** @ngInject */
function loginController(localStorageService, AuthService) {
...