Skip to content

Instantly share code, notes, and snippets.

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

Josias Josiastech

🏠
Working from home
View GitHub Profile
Option Explicit
Function EvaluarFuncion(Ecuacion As String, Punto1 As Double, Optional Punto2 As Double, Optional Punto3 As Double, Optional Punto4 As Double, Optional Punto5 As Double)
Dim SustEcuacion As String
Dim Formula As ScriptControl
Set Formula = New ScriptControl
Formula.Language = "VBScript"
SustEcuacion = WorksheetFunction.Substitute(Ecuacion, "VAR1", CStr(Punto1))
SustEcuacion = WorksheetFunction.Substitute(SustEcuacion, "VAR2", CStr(Punto2))
mkdir -p ~/.local/share/fonts
for type in Bold Light Medium Regular Retina; do wget -O ~/.local/share/fonts/FiraCode-$type.ttf "https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-$type.ttf?raw=true"; done
fc-cache -f
<?php
if(isset($_POST['product'])){
$checkbox = $_POST['product'];
}
$suma = 0;
foreach ($_POST['product'] as $key => $value) {
$suma += $value;
<?php
// Create
$product=new Axon('products');
$product->product_id=123;
$product->description='Product Description';
$product->save();
// Update
$product->load('product_id=123');
@Josiastech
Josiastech / 0_reuse_code.js
Created August 18, 2014 21:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#include<stdio.h>
#include<string.h>
#include<pthread.h>
#include<stdlib.h>
#include<unistd.h>
pthread_t tid[2];
void* doSomeThing(void *arg)
{
@Josiastech
Josiastech / form.html
Created October 11, 2013 20:14
form.html
<form action="http://www.collegesanduniversities.org/quick-schools-results" id="bwform" method="get" name="bwform" onsubmit="return bwvalidateForm(this);" style="width: 293px; height: 208px;">
<!-- program-->
<div style="margin-left: 40px; padding-left:0; position: absolute; margin-top: 85px; *margin-top: 20px;">
<input type="hidden" name="areaOfStudy" value="1">
<select name="subAreaOfStudy" onchange="settingAreaOfStudy('vm-form')" style="width: 213px; height: 23px;font-size: 11px; font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#666; font-weight:bold;">
<option value="" selected="selected" disabled="disabled" style="font-weight: bold !important;">Select an area of study</option>
<optgroup label="Business">
<option value="1">General Business</option>
@Josiastech
Josiastech / Python_Install
Created October 10, 2013 14:24
Python Install
Instala un editor de código
http://www.sublimetext.com/2
Instala Python, Django y entornos virtuales
Primeros pasos: instalación de Python + entornos virtuales
Cuando trabajamos en Django cada proyecto puede necesitar diferentes especificaciones, desde la versión hasta dependencias muy puntuales. Para solucionarlo tenemos los entornos virtuales. Estos se encargan de crear un entorno apartado del sistema, basado en Python, con el objetivo de tener distintos proyectos al mismo tiempo y con distintas características (en dependencias y versiones). Uno de ellos es virtualenv.
Instalando Python, pip y virtualenv
En Mac OS:
* Primero debemos instalar Hombrew. Este es un gestor de paquetes de UNIX decente para Mac OS. Abrimos terminal y digitamos el siguiente comando:
<?php
public function login_form() {
global $ws, $obj;
$validate_login = $obj -> _get_form_login($_REQUEST);
if ($validate_login->succes) {
$a = $ws -> user_authenticate(array(
'config' => $this->config,
'email' => $validate_login->login->email,
@Josiastech
Josiastech / maps.html
Last active October 11, 2015 12:57
$number->data;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="es">
<head>
<title>Obtener coordenadas de google maps</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAGAEGVZIXwwutieHF4QOL4RRpYoRN0FKJQ7RZd_AzeNEq2PLjZhR3W4-qrIA2KyJ0hRw-barmpbORVQ"
type="text/javascript">
</script>
<script type="text/javascript">