Skip to content

Instantly share code, notes, and snippets.

View ovicko's full-sized avatar
🎯
Focusing

AMWOLLO VICTOR ovicko

🎯
Focusing
View GitHub Profile
/** Creating and Deploying using Git, Github and PHP **/
Prerequisites:
Server: SSH Acces, PHP, Git
Local: SSH, Git
0.Create a PHP file in your project called "deploy.php" with this content: /*<?php `git pull`;*/
1. Create Your Github Repo
2. Go to your project folder and initiate a git repository
@ovicko
ovicko / MultiPartUtility.java
Created May 25, 2017 17:16 — forked from Antarix/MultiPartUtility.java
Uploading Multiple files at once with Post and Header parameter in Android
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
@ovicko
ovicko / arrayToCSV.js
Created November 10, 2018 21:40 — forked from yangshun/arrayToCSV.js
Converts a 2D array into a CSV file
function arrayToCSV (twoDiArray) {
// Modified from: http://stackoverflow.com/questions/17836273/
// export-javascript-data-to-csv-file-without-server-interaction
var csvRows = [];
for (var i = 0; i < twoDiArray.length; ++i) {
for (var j = 0; j < twoDiArray[i].length; ++j) {
twoDiArray[i][j] = '\"' + twoDiArray[i][j] + '\"'; // Handle elements that contain commas
}
csvRows.push(twoDiArray[i].join(','));
}
2019-05-19 11:06:51.590 14508-15246/one.block.androidexampleapp W/System.err: one.block.eosiojava.error.session.TransactionSignAndBroadCastError: one.block.eosiojava.error.session.TransactionCreateSignatureRequestRpcError: Error happened on calling getRequiredKeys RPC call.
2019-05-19 11:06:51.590 14508-15246/one.block.androidexampleapp W/System.err: at one.block.eosiojava.session.TransactionProcessor.signAndBroadcast(TransactionProcessor.java:483)
2019-05-19 11:06:51.591 14508-15246/one.block.androidexampleapp W/System.err: at one.block.androidexampleapp.TransactionTask.doInBackground(TransactionTask.java:140)
2019-05-19 11:06:51.591 14508-15246/one.block.androidexampleapp W/System.err: at one.block.androidexampleapp.TransactionTask.doInBackground(TransactionTask.java:34)
2019-05-19 11:06:51.591 14508-15246/one.block.androidexampleapp W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:345)
2019-05-19 11:06:51.591 14508-15246/one.block.androidexampleapp W/System.err: at java.util.
@ovicko
ovicko / media-query.css
Created June 2, 2019 15:00 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@ovicko
ovicko / RetrofitHelper.java
Last active June 11, 2019 18:09
RetrofitHelper
public class RetrofitHelper {
private Retrofit.Builder retrofit;
public RetrofitHelper() {
retrofit = new Retrofit.Builder()
.baseUrl(RetrofitApi.BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.client(new OkHttpClient()
.newBuilder()
.addNetworkInterceptor(
@ovicko
ovicko / DeCryptor.java
Created June 12, 2019 20:43 — forked from JosiasSena/DeCryptor.java
Encryptor and Decryptor for data encryption.decryption using the Android KeyStore.
/**
_____ _____ _
| __ \ / ____| | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__|
| |__| | __/ |____| | | |_| | |_) | || (_) | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_|
__/ | |
|___/|_|
*/

👋 Hi! I'm Victor, a Web and Android Developer with passion in ecommerce and have specialized in building custom software to enable entrepreneurs launch and grow their online business

@ovicko
ovicko / Records.php
Last active May 19, 2021 10:04
Create a constant that will identify the event in your ActiveRecord class.
<?php
class Records extends \yii\db\ActiveRecord
{
//create the event name
const EVENT_SEND_EMAIL_UPDATE = ‘send-email-to-users’;
}
@ovicko
ovicko / Records.php
Last active May 19, 2021 10:05
Attach the event handler in the init method of your ActiveRecord.
<?php
class Records extends \yii\db\ActiveRecord
{
const EVENT_SEND_EMAIL_UPDATE = 'send-email-to-users';
public function init()
{
// first parameter is the name of the event and second is the handler. 
// sendMail method from $this class.
$this->on(self::EVENT_SEND_EMAIL_UPDATE, [$this, 'sendMail']);
parent::init(); // DON'T Forget to call the parent method.