Skip to content

Instantly share code, notes, and snippets.

View jasson112's full-sized avatar
👽

jasson rojas jasson112

👽
View GitHub Profile
@jasson112
jasson112 / phpenv-ubuntu-xenial.sh
Created July 16, 2022 06:46 — forked from christopher-hopper/phpenv-ubuntu-xenial.sh
Install phpenv on Ubuntu 16.04 LTS (xenial)
#!/usr/bin/env bash
# vim: ai ts=2 sw=2 et sts=2 ft=sh
# Check OS.
if [[ ! "${OSTYPE}" =~ "^linux" ]] || [[ ! "$(lsb_release -c 2>/dev/null)" =~ "xenial" ]]; then
(>&2 echo "Error: This script is for Ubuntu 16.04 LTS (xenial) not '${OSTYPE}'.")
exit 1;
fi
sudo apt-get update
@jasson112
jasson112 / javascript-proxy-as-rest-client.js
Created February 9, 2022 13:35 — forked from DavidWells/javascript-proxy-as-rest-client.js
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
@jasson112
jasson112 / bootstrap.js
Created October 21, 2021 22:26 — forked from dmgallardo/bootstrap.js
strapi-starter-blog/config/functions/bootstrap.js
"use strict";
require("dotenv").config();
/**
* An asynchronous bootstrap function that runs before
* your application gets started.
*
* This gives you an opportunity to set up your data model,
* run jobs, or perform some special logic.
*
* See more details here: https://strapi.io/documentation/3.0.0-beta.x/concepts/configurations.html#bootstrap
@jasson112
jasson112 / pillow-to-s3-methods.py
Last active October 15, 2020 00:16 — forked from ghandic/pil_s3.py
Load image from S3 directly into memory as PIL image and write to S3 directly from memory from PIL image
import boto3
from PIL import Image
from io import BytesIO
import os
class S3ImagesInvalidExtension(Exception):
pass
class S3ImagesUploadFailed(Exception):
pass
console.log("new form git hub gist");
var cartItems = []
$(document).ready(function(){
$(".goto-form").click(function(){
console.log("on the button click")
$("#step1").toggle();
$("#step2").toggle();
})
$(".add-addon").click(function(){
$(this).toggle();
"autoload": {
"psr-4": {
"": "vendor/phpoffice/phpexcel/Classes/",
},
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;
/**
* @var ClassLoader $loader
*/
$loader = require __DIR__.'/../vendor/autoload.php';
@jasson112
jasson112 / CellWriter.php
Created June 20, 2016 15:11
adding color to laravel excel, in LaravelExcelWorksheet.php on line 1026 function setBorder and CellWriter.php on line 134 function setBorder
<?php namespace Maatwebsite\Excel\Writers;
use Maatwebsite\Excel\Classes\LaravelExcelWorksheet;
/**
*
* LaravelExcel Excel writer
*
* @category Laravel Excel
* @version 1.0.0