2020-11-14

How to install Git on Android phone

Questioned myself, is it possible to create git repository on android phone, edit project files on android phone and then push these to remote repository? Appeared that it is possible and works really well!

In order to do that I have installed Termux, Termux:Api, Termux:Widget. It is important to install all three apps from one market - they exist in F-Droid и Android Play Market but the last one in Android Play costs $2 but in F-Droid - it is free.

Run Termux and install all necessary packages, allow access to file system:


pkg install git openssh termux-api
termux-setup-storage

Create project folder:


mkdir /storage/emulated/0/Documents/work
cd /storage/emulated/0/Documents/work
git init
git remote add origin git@github.com:username/reponame.git
git config --global user.email "your@email.com"
git config --global user.name "Max"
nano readme.md
git add readme.md
git commit -am"first commit"
#create keys pair:
ssh-keygen
cat /data/data/com.termux/files/home/.ssh/id_rsa.pub
#copy the public key into the remote folder.

Creating folder with startup scripts:


mkdir -p $HOME/.shortcuts
mkdir -p /data/data/com.termux/files/home/.shortcuts/tasks
cd /data/data/com.termux/files/home/.shortcuts/
nano ./push.sh 
chmod +x push.sh

push.sh looks like this:


#!/data/data/com.termux/files/usr/bin/bash
cd /storage/emulated/0/Documents/work
git add *
git commit -am"autocommit"
git push origin master
termux-toast "Changes successfully pushed" 

Create pull.sh:


#!/data/data/com.termux/files/usr/bin/bash
cd /storage/emulated/0/Documents/work
git pull origin master
termux-toast "Changes successfully pulled"

Add the widget on our screen and use it to trigger pull и push scripts from there!

Now I can push and pull changes from my phone screen!

 

Оставить комментарий

 
  2020-10-18

Floating point precision

Found interesting thing in Raimond Hattinger twitter for Python.

It works also in Javascript:

var x = 12345678901234567.0
console.log(x === x + 1); //true	

 

Оставить комментарий

 
  2020-05-05

Interactive Vim Tutorial

Found very simple Interactive Vim Tutorial. If you want to grab some Vim magic - really recommend it.

 

Оставить комментарий

 
  2020-04-16

Leetcode 30 challenge

The best usage of time during quarantine is developing your coding skills in 30 Leetcode Challenge - I love it, just select your favorite programming language and solve tasks. It is super helpful if you are software engineer or just love programming. 

 

Оставить комментарий

 
  2020-04-09

Site redesign

Decided to rededign this website a little bit. If there will be any problems with it lately, please let me know. Generally there are may things I want to do - add support of social networks, messengers, fix the registration flow which is broken for many years... Surely all this will be never done, but...

 

Оставить комментарий

 
  2013-01-01

Simple Text Editor

Created new version of Simple Text Editor for Android.

- fixed a lot of issues;
- added new customiation settings for font and background colors, font selectors etc.;
- simplified file selector dialog;
- created new icons;
- added new "Save As" and "New" comand;
- many some other minor changes

Now it is full features text editor which is available on Google Play.

 

Коментариев: 2

 
  2012-04-03

Infusionsoft API for humans

For one of projects, I had to implement integration with Infusionsoft. Reviewing the API documentation I found it very simple to use, but when I looked into their SDK it did not like me too much. Properly say it seemed me horrible. How they would be able to create such ugly SDK for such nice API? 

First of all I did not like xmlrps third party library used in it, it was written by Edd Dumbill long ago and did non seem me very beautiful - the php itself already has nice XML RPC implementation since version 4.0 (though, yes, I had sin to write own XML RPS too...) . The structure of API is not very convenient because I have to pass API key to ALL api functions - it would be logical for SDK to store key and use it with later calls - I am too lazy to write it every time. 

Another thing iSDK is uses one class with lots of functions - it would be logical to use classes which represents basic services in infusionsoft API.

Most of functions in SDK have different names then original API functions, furthemore names are very strange and nonintuitive -  can you let me know what does function addCon or campAssign?

So I went to idea to create own Infusionsoft API implementation.

- it would have proper type hinting that would help me use proper method names in Eclipse
- would have same method names as used in Infusionsoft XML RPC calls
- it would require to pass API keys in every call
- it would have transparent arguments without any php_xmlprc_encode crap

I am too lazy to code this by hand so I am created simple parser that takes infusionsoft API documentation and parses it creating nice friendly human oriented API.

The final API (and generating script) I have uploaded to hithub. Hope it would help to somebody with work with Infusionsoft via their API.

Enjoy.

 

Оставить комментарий

 
  2012-02-09

New domain name for Preloaders Generator

webmastering

Just obtained new domain name for my small generator of animated gif images. Now it will be awailable using address: preloader.org.

I hope in nearest time to upload the project, add several types of new preloaders, create new outfit and also add new cool features.

 

Оставить комментарий

 
  2012-01-31

Camera support in Android Firefox

webmastering

Several days ago, my Android phone asked me manualy update firefox browser. Usually it does not require manual update, but now it did, it was caused presumably because application permissions was changed. As I hoped the change was in camera permissions - if old version was not able to use camera at all because of lack of necessary permissions now when I manually accepted new permission set with camera access it should be possible.

So new version is capable to upload images right from mobile camera. It is working the following way: once you opened the page with upload button, the upload button has small "capture" button near it. If you click the button small preview window will appear with camera capture preview.

To activate new feature you should set up for the tag input[type=file] attribute accept="image/png"

Open this page on your mobile firefox to see this in action: http://maxistar.ru/kitchen/camera.html

It was tested on Motorolla Milestone 2 (Android 2.2)

 

Оставить комментарий

 
  2008-01-14

New hosting transfer

It's possible site will be unavailable some time because of transfer to new hosting.
 

Оставить комментарий