Skip to content

Instantly share code, notes, and snippets.

View pabmar68hotmail's full-sized avatar

Pablo Marinho pabmar68hotmail

View GitHub Profile
@pabmar68hotmail
pabmar68hotmail / config.php
Created March 16, 2023 23:39 — forked from 3mrdev/config.php
Odoo XMLRPC Example using PHP
<?php
// like import file
require_once('lib/ripcord.php');
// define variables to use in future
$url = "http://localhost:8015";
$db = "o14_api";
$username = "admin";
$password = "admin";
// Primero creamos un ID de conexión a nuestro servidor
$cid = ftp_connect("www.web.mx");
// Luego creamos un login al mismo con nuestro usuario y contraseña
$resultado = ftp_login($cid, "user","xxxxxx");
// Comprobamos que se creo el Id de conexión y se pudo hacer el login
if ((!$cid) || (!$resultado)) {
echo "Fallo en la conexión"; die;
} else {
echo "Conectado.";
}
@pabmar68hotmail
pabmar68hotmail / ftpphp
Created March 1, 2023 22:17 — forked from BenjaminGuV/ftpphp
Ejemplo de FTP en php
<?php
set_time_limit(0);
function leerDierctorio($ruta){
if($dir = opendir($ruta)){
chdir($ruta);
//Creamos los array de archivos y carpetas
$archivos=array();
$carpetas=array();
@pabmar68hotmail
pabmar68hotmail / Transactions.sol
Created January 30, 2022 21:17 — forked from adrianhajdin/Transactions.sol
Build and Deploy a Modern Web 3.0 Blockchain App | Solidity, Smart Contracts
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "hardhat/console.sol";
contract Transactions {
uint256 transactionCount;
event Transfer(address from, address receiver, uint amount, string message, uint256 timestamp, string account, string keyword);
@pabmar68hotmail
pabmar68hotmail / connectivity.coffee
Created September 3, 2021 17:47 — forked from zachdunn/connectivity.coffee
AngularJS Directive for easily attaching online & offline events
'use strict';
angular.module('angularApp')
.directive('connectivity', ($window, $parse) ->
return ($scope, element, $attrs) ->
# Parse attribute value into JSON
events = $scope.$eval($attrs.connectivity)
# Loop through events in JSON object
@pabmar68hotmail
pabmar68hotmail / TwinCat.cs
Created August 26, 2021 00:07 — forked from Nobatgeldi/TwinCat.cs
TwinCat Read/Write PLC of string variables
using System;
using System.IO;
using TwinCAT.Ads;
namespace TwinCAT_ADS
{
class Program
{
private static int varHandle;
private TcAdsClient adsClient;
@pabmar68hotmail
pabmar68hotmail / index.py
Created August 6, 2021 01:14 — forked from fazt/index.py
Python Simple Discord Bot
import discord
from discord.ext import commands
import datetime
from urllib import parse, request
import re
bot = commands.Bot(command_prefix='>', description="This is a Helper Bot")
@bot.command()
@pabmar68hotmail
pabmar68hotmail / TaskContract.sol
Created August 6, 2021 00:48 — forked from fazt/TaskContract.sol
A CRUD Tasks contract
pragma solidity ^0.8.6;
contract TaskCrud {
struct Task {
uint id;
string name;
string description;
}
@pabmar68hotmail
pabmar68hotmail / README-español.md
Created January 9, 2021 23:17 — forked from Villanuevand/README-español.md
Una plantilla para hacer un buen README.md. Inspirado en el gist de @PurpleBooth => https://gist.github.com/PurpleBooth/109311bb0361f32d87a2

Título del Proyecto

Acá va un párrafo que describa lo que es el proyecto

Comenzando 🚀

Estas instrucciones te permitirán obtener una copia del proyecto en funcionamiento en tu máquina local para propósitos de desarrollo y pruebas.

Mira Deployment para conocer como desplegar el proyecto.

@pabmar68hotmail
pabmar68hotmail / uploadMethodOne.php
Created December 3, 2020 01:29 — forked from chirag-shinde/uploadMethodOne.php
PHP Script to Upload CSV to MongoDB. Method One of Two.
<?php
//Your Database Connection include file here.
//This Entire PHP part can be placed in a seperate action file
//Upload File
if (isset($_POST['submit'])) {
//Upload Directory path.
$uploaddir = 'uploads/';
//FilePath with File name.
$uploadfile = $uploaddir . basename($_FILES["filename"]["name"]);