Skip to content

Instantly share code, notes, and snippets.

View blenderdeluxe's full-sized avatar
❤️
I love programming

Diego Cortés blenderdeluxe

❤️
I love programming
View GitHub Profile
<?php
// ...
protected $middleware = [
// ...
'App\Http\Middleware\ValidProxies',
];
// ...
@blenderdeluxe
blenderdeluxe / obtener_costo_envio_paquete.php
Created November 22, 2016 21:35 — forked from baamenabar/obtener_costo_envio_paquete.php
Obtener costos de envío por Chilexpress, usando el formulario de cálculo que tienen ellos. A falta de un API, hay que hacerse uno. Todo mérito a @nikoskip
<?php
/**
* Una simple función para obtener los costos de envío de un paquete mediante Chilexpress.
* Como única dependencia se necesita de la liberia PHP Simple HTML DOM Parser: http://simplehtmldom.sourceforge.net/
*
* Para poder comunicarse con Chilexpress, se debe tener la lista de todas las comunas que ellos utilizan y el código
* que le asignan a cada una. En este archivo, al final, podrás encontrar el listado, el cual podrás parsear fácilmente
*/
@blenderdeluxe
blenderdeluxe / swiper-magnific-popup.js
Created November 25, 2016 06:17 — forked from thiagoeliasr/swiper-magnific-popup.js
Adding swipe support to Magnific Popup galleries. (touchSwipe is required: http://labs.rampinteractive.co.uk/touchSwipe/demos/)
(function() {
/* Define a variável que dá swipe no lightbox */
var magnificPopup = $.magnificPopup.instance;
/* Carrega a função quando clica no lightbox (senão não pega a classe utilizada) */
$("a.image-lightbox").click(function(e) {
/* Espera carregar o lightbox */
setTimeout(function() {
/* Swipe para a esquerda - Próximo */
@blenderdeluxe
blenderdeluxe / laravel-forge-deploy.sh
Created February 2, 2017 21:53 — forked from rap2hpoutre/laravel-forge-deploy.sh
Laravel Forge deploy script without downtime
# stop script on error signal
set -e
# remove old deployment folders
if [ -d "/home/forge/deploy" ]; then
rm -R /home/forge/deploy
fi
if [ -d "/home/forge/backup" ]; then
rm -R /home/forge/backup
fi
@blenderdeluxe
blenderdeluxe / index.html
Created February 12, 2017 00:43 — forked from arisetyo/index.html
Dynamic Real-time Chart Using Chart.js, Socket.io, and Knockout.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Galenic">
<script src="js/jquery-1.9.1.js"></script>
<script src="js/knockout-2.1.0.js"></script>
<script src="js/Chart.js"></script>
<link rel="stylesheet" href="pure-min.css">
@blenderdeluxe
blenderdeluxe / animate.py
Last active April 9, 2017 19:47
2D Sprites BGE
import bge
cont = bge.logic.getCurrentController()
own = cont.owner
if own['currentFrame'] <= own['maxFrame']:
own.replaceMesh(own['meshName'] + str(own['currentFrame']), 1, 0)
own['name'] = own['meshName'] + str(own['currentFrame'])
own['currentFrame'] += 1
@blenderdeluxe
blenderdeluxe / vray_subdivision_to_multiple_objects.py
Created April 12, 2017 23:14
Add vray subdivision to multiple objects in Maya
#Run script in python view on script editor
#Select all objects that need apply vray subdivision
#Execute in maya python console makeVrayAttributes(1)
import maya.cmds as cmds
import maya.mel as mel
def makeVrayAttributes(startID=1):
sel = cmds.ls(sl=1)
currentID=startID
@blenderdeluxe
blenderdeluxe / adminer_setup.sh
Created June 14, 2017 00:56 — forked from zloynemec/adminer_setup.sh
Secure adminer nginx setup
# Secure adminer setup
# Author Taras Kozlov
# download adminer to separate directory
mkdir -p /var/www/admin
cd /var/www/admin
wget http://www.adminer.org/latest.php -O adminer.php
echo '<?php phpinfo(); >' > info.php
sudo -i
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFollow : MonoBehaviour {
public GameObject target;
// Use this for initialization
void Start () {
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFollow : MonoBehaviour
{
private float rightBound;
private float leftBound;
private float topBound;