Skip to content

Instantly share code, notes, and snippets.

View jorgecar's full-sized avatar

Jorge Carballo jorgecar

View GitHub Profile
@jorgecar
jorgecar / componentes.js
Created September 18, 2025 20:38
Componentes
This file has been truncated, but you can view the full file.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "Components",
"description": "",
"components": {
"product-porfolio": {
"type": "object",
"title": "Product Portfolio",
"description": "",
@jorgecar
jorgecar / product-portfolio.json
Created September 18, 2025 06:42
Product Portfolio Schema
This file has been truncated, but you can view the full file.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "Product Portfolio",
"description": "",
"properties": {
"layout": {
"type": "object",
"title": "Layout & background",
"options": {
@jorgecar
jorgecar / FileUploader.vue
Created March 5, 2019 22:05 — forked from CristalT/FileUploader.vue
File Uploader Component for Vue.js using Firebase Storage
<template>
<div>
<input type="file" multiple accept="image/jpeg" @change="detectFiles($event.target.files)">
<div class="progress-bar" :style="{ width: progressUpload + '%'}">{{ progressUpload }}%</div>
</div>
</template>
<script>
@jorgecar
jorgecar / gist:2fabddc606073ab5ad33e7cb622550ed
Created December 12, 2018 10:29 — forked from philfreo/gist:b307afd2339767481426
How to have Flask download a file and then serve it as an attachment
@app.route('/download/', methods=['GET'])
def download():
url = request.args['url']
filename = request.args.get('filename', 'image.png')
r = requests.get(url)
strIO = StringIO.StringIO(r.content)
return send_file(strIO, as_attachment=True, attachment_filename=filename)
import os
import csv
import logging
import boto3
from schematics.models import Model
from schematics.types import StringType, IntType
logging.getLogger()
@jorgecar
jorgecar / build-git.sh
Created November 18, 2016 07:54 — forked from pescobar/build-git.sh
compile git with openssl instead of gnutls
#!/usr/bin/env bash
# Clear out all previous attempts
rm -rf "/tmp/source-git/"
# Get the dependencies for git, then get openssl
sudo apt-get install build-essential fakeroot dpkg-dev -y
sudo apt-get build-dep git -y
sudo apt-get install libcurl4-openssl-dev -y
mkdir -p "/tmp/source-git/"
@jorgecar
jorgecar / README-Template.md
Created November 3, 2016 13:05 — 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

@jorgecar
jorgecar / hook_theme.inc
Last active October 25, 2016 20:54
Custom TPL
<?php
#You have to write your own module. In your module you have to define your theme using hook_theme function.
function mymodule_theme($existing, $type, $theme, $path) {
return array(
'your_theme_key' => array(
'variables' => array(
'nid' => NULL,
'title' => NULL
),
'template' => 'your_template_filename', // do not include .tpl.php
@jorgecar
jorgecar / dpm.py
Created October 4, 2016 19:36
Python Flask debug variable
from flask import Flask, Response
import pprint
@app.route('/')
def index:
return dpm(response)
def dpm(variable):
pp = pprint.PrettyPrinter(indent=4, depth=6)
debug_message = pp.pprint(variable)
@jorgecar
jorgecar / gist:d532337dd0753fddb1ffde9c98af8b31
Created July 14, 2016 06:56 — forked from hannesl/gist:3864416
Delete/cancel a Drupal user programmatically and safely.
// Tell Drupal to cancel this user.
// The third argument can be one of the following:
// - user_cancel_block: disable user, leave content
// - user_cancel_block_unpublish: disable user, unpublish content
// - user_cancel_reassign: delete user, reassign content to uid=0
// - user_cancel_delete: delete user, delete content
user_cancel(array(), $uid, 'user_cancel_reassign');
// user_cancel() initiates a batch process. Run it manually.
$batch =& batch_get();