Skip to content

Instantly share code, notes, and snippets.

View delineas's full-sized avatar
🚀
Launching...

Daniel Primo delineas

🚀
Launching...
View GitHub Profile
@delineas
delineas / isbn_search.rb
Created October 25, 2021 14:18 — forked from luisparravicini/isbn_search.rb
Busca la informacion de un libro segun su isbn
#!/usr/bin/ruby1.9.1
# Script para traducir isbn a informacion del libro buscando en varias
# librerias online. Se probo por ultima vez el 2009-12-11.
#
# Author:: Luis Parravicini
# Copyright:: Copyright (C) 2009 Luis Parravicini
# License:: GPL v2
#
# http://ktulu.com.ar/blog/2009/12/11/traduciendo-isbn/
@delineas
delineas / iCal.php
Created September 23, 2021 20:14 — forked from seebz/iCal.php
iCal PHP Parser
<?php
class iCal
{
/**
* @var string
*/
public $title;
@delineas
delineas / __upload_file.md
Created March 22, 2021 08:33 — forked from maxivak/__upload_file.md
PHP upload file with curl (multipart/form-data)

We want to upload file to a server with POST HTTP request. We will use curl functions.


// data fields for POST request
$fields = array("f1"=>"value1", "another_field2"=>"anothervalue");

// files to upload
$filenames = array("/tmp/1.jpg", "/tmp/2.png");
@delineas
delineas / gh-pages.yml
Created April 29, 2020 09:25 — forked from syuji-higa/gh-pages.yml
GitHub Actions - Genelate Nuxt.js deploy for GitHub Pages
name: github pages
on:
push:
branches:
- master
jobs:
build-deploy:
runs-on: ubuntu-18.04
@delineas
delineas / some_test.js
Created January 4, 2020 10:09 — forked from mbrochh/some_test.js
Controlling a Stripe payent popup with Cypress.io
// for this to work you need to set `"chromeWebSecurity": false` in cypress.json
describe('Make Stripe Payment', function() {
before(function() {
cy.visit('http://localhost:3000/en/stripe/checkout/')
Cypress.Cookies.preserveOnce('sessionid')
})
it('should enter credit card details and finalise payment', function() {
cy.get('[data-test="button-FormStripeCart-PayWithCreditCard"]').click()
@delineas
delineas / array_flatten.php
Created July 10, 2019 16:21 — forked from SeanCannon/array_flatten.php
PHP array_flatten() function. Convert a multi-dimensional array into a single-dimensional array.
<?php
/**
* Convert a multi-dimensional array into a single-dimensional array.
* @author Sean Cannon, LitmusBox.com | seanc@litmusbox.com
* @param array $array The multi-dimensional array.
* @return array
*/
function array_flatten($array) {
if (!is_array($array)) {
@delineas
delineas / gist:1e55c9cb911e631174a93726b553d45e
Created May 23, 2019 13:32 — forked from johnennewdeeson/gist:22196a15b3ea115a2451
Make alt text required when uploading images using media widget (Drupal)
/**
* Implements hook_form_FORM_ID_alter().
*/
function mymodule_form_file_entity_add_upload_alter(&$form) {
_mymodule_media_form_alter($form);
}
/**
* Implements hook_form_FORM_ID_alter().
*/
@delineas
delineas / Flask_JWT_Auth
Created March 5, 2019 23:40 — forked from prameshbajra/Flask_JWT_Auth
Flask API JWT Authentication without database.
from flask import Flask
from flask_jwt import JWT, jwt_required, current_identity
from werkzeug.security import safe_str_cmp
class User(object):
def __init__(self, id, username, password):
self.id = id
self.username = username
self.password = password
@delineas
delineas / branch-organization.md
Created October 23, 2018 22:30 — forked from wilmoore/branch-organization.md
Branch Organization

Scenario

Work is done within a feature branch created from master. You've incrementally gotten the feature branch working as expected; however, you'd prefer to re-organize your commits so that you can better reason about the changes.

Setup

Let's create a new repository in order to set the stage:

 % mkdir repo
 % cd repo

% git init

@delineas
delineas / drupal8-links.php
Created July 24, 2018 18:35 — forked from colorfield/drupal8-links.php
Drupal 8 links, or where is my l() function