Skip to content

Instantly share code, notes, and snippets.

View lokcito's full-sized avatar

ray lokcito

View GitHub Profile
@lokcito
lokcito / Gemfile-heroku
Last active October 2, 2021 16:49
Gemfile + Gemfile.lock for replit deploy on Heroku, Ruby 2.5.8. Do you want deploy Rails from replit to Heroku? , you should replace the Gemfile just for deploy and restore if you want continue working with Replit
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.8'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem 'rails', '~> 6.1.4', '>= 6.1.4.1'
# Use sqlite3 as the database for Active Record
# gem 'sqlite3', '~> 1.4'
# Use Puma as the app server
@lokcito
lokcito / class.cs
Created September 15, 2021 20:00
C# Upload imagen FromForm , Multipart
public class FIleUploadAPI
{
public IFormFile oneimage { get; set; }
public String cellNumber { get; set; }
public String otroCampo { get; set; }
public String otroCampo2 { get; set; }
}
[Route("/api/v1/student/CAU/Ticket/new")]
[HttpPost]
@lokcito
lokcito / bootstrap.sh
Last active July 30, 2021 04:08
Vagrant Setup for RoR
#!/usr/bin/env bash
# actualizar el sistema completamente
echo mejorar y actualizar el sistema
sudo apt-get update
sudo apt-get -y upgrade
# instalar node.js para ejecutar comandos js al utilizar Rails
echo instalando node.js para ejecutar JS y Git
sudo apt-get install -y nodejs
sudo apt-get install -y git
@lokcito
lokcito / README.md
Created August 6, 2020 18:33
C# Datagrid Command Line

#How to compile

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe -reference:Newtonsoft.Json.dll /target:winexe .\Table.cs

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe -r:Newtonsoft.Json.dll /target:winexe .\Table.cs

@lokcito
lokcito / PaymentController.php
Created July 29, 2020 04:56
Culqui Payment With Php Laravel 7 and Guzzle php version 6
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\Log;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Exception\RequestException;
public class DatabaseHelper extends SQLiteOpenHelper {
....
public static class Columns implements BaseColumns {
public static final String COLUMN_NAME_TOKEN = "token";
public static final String COLUMN_NAME_NAME = "name";
public static final String COLUMN_NAME_TITLE = "title";
public static final String COLUMN_NAME_MESSAGE = "message";
public static final String COLUMN_NAME_EXTRA = "extra";
public static final String COLUMN_NAME_ACTIVE = "is_active";
public static final String COLUMN_NAME_CHANNEL = "channel";
@lokcito
lokcito / component.ts
Last active January 21, 2020 01:27
servicios angular
import { Component, OnInit } from '@angular/core';
import { ViewEncapsulation } from '@angular/core'
import { Router, ActivatedRoute } from '@angular/router';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { LoginService } from './login.service';
@Component({
selector: 'app-login',
@lokcito
lokcito / Channel.java
Last active January 16, 2020 01:00
Android Sqlite
package info.rayrojas.avispa.models;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;
import java.util.ArrayList;
public static void sendRequestPOST(QueueUtils.QueueObject o, final MainActivity _interface) {
String url = "http://rrojasen.alwaysdata.net/purchaseorders.json";
url = "http://fipo.equisd.com/api/users/new.json";
url = "http://192.168.58.3:8056/api/users/new.json";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
//Do it with this it will work
@lokcito
lokcito / listview-images.java
Last active December 19, 2019 02:17
ListView con imagenes
// Rutas:
// https://mymodernmet.com/wp/wp-content/uploads/2019/09/100k-ai-faces-3.jpg
// https://mymodernmet.com/wp/wp-content/uploads/2019/09/100k-ai-faces-8.jpg
// https://mymodernmet.com/wp/wp-content/uploads/2019/09/100k-ai-faces-7.jpg
// https://mymodernmet.com/wp/wp-content/uploads/2019/09/100k-ai-faces-4.jpg
// build.gradle (Module: App)
dependencies {
....
implementation 'com.android.volley:volley:1.1.1'
}