Skip to content

Instantly share code, notes, and snippets.

View avipars's full-sized avatar
🎯
Focusing

Avi Parshan avipars

🎯
Focusing
View GitHub Profile
@GigigoGreenLabs
GigigoGreenLabs / LocaleUtils.java
Last active February 15, 2023 12:16
Change the locale language inside the app
import android.app.Application;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.view.ContextThemeWrapper;
import java.util.Locale;
public class LocaleUtils {
[{"country":"Afghanistan","code":"93","iso":"AF"},
{"country":"Albania","code":"355","iso":"AL"},
{"country":"Algeria","code":"213","iso":"DZ"},
{"country":"American Samoa","code":"1-684","iso":"AS"},
{"country":"Andorra","code":"376","iso":"AD"},
{"country":"Angola","code":"244","iso":"AO"},
{"country":"Anguilla","code":"1-264","iso":"AI"},
{"country":"Antarctica","code":"672","iso":"AQ"},
{"country":"Antigua and Barbuda","code":"1-268","iso":"AG"},
{"country":"Argentina","code":"54","iso":"AR"},
@pickletoni
pickletoni / countryPhoneCodes.json
Last active April 10, 2024 19:40 — forked from AdonaiAraya/countryPhoneCodes.json
JSON array of 248 countries with phone codes and ISO country code
[{"country":"Afghanistan","code":"93","iso":"AF"},
{"country":"Albania","code":"355","iso":"AL"},
{"country":"Algeria","code":"213","iso":"DZ"},
{"country":"American Samoa","code":"1-684","iso":"AS"},
{"country":"Andorra","code":"376","iso":"AD"},
{"country":"Angola","code":"244","iso":"AO"},
{"country":"Anguilla","code":"1-264","iso":"AI"},
{"country":"Antarctica","code":"672","iso":"AQ"},
{"country":"Antigua and Barbuda","code":"1-268","iso":"AG"},
{"country":"Argentina","code":"54","iso":"AR"},
#import necessary libraries
import cv2
import numpy as np
#capture video from the webcam
cap = cv2.VideoCapture(0)
#load the face finder
face_cascade = cv2.CascadeClassifier('/home/sm/Desktop/haarcascade_frontalface_default.xml')
@kennyung6
kennyung6 / ContactActivity.java
Created August 29, 2016 14:32 — forked from sourabh86/ContactActivity.java
Code to send data to Google Docs sheet from Android activity
package in.codesmith.contactusexample;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
@TimSC
TimSC / line-plane-collision.py
Last active April 7, 2023 11:00
Line-Plane collision in 3D, Python 2 or 3
#Line-plane intersection
#By Tim Sheerman-Chase
#This software may be reused under the CC0 license
#Based on http://geomalgorithms.com/a05-_intersect-1.html
from __future__ import print_function
import numpy as np
def LinePlaneCollision(planeNormal, planePoint, rayDirection, rayPoint, epsilon=1e-6):
@freak4pc
freak4pc / IsraeliID.Validator.js
Last active January 21, 2024 08:29
Israeli ID Validator (Javascript)
function isValidIsraeliID(id) {
var id = String(id).trim();
if (id.length > 9 || id.length < 5 || isNaN(id)) return false;
// Pad string with zeros up to 9 digits
id = id.length < 9 ? ("00000000" + id).slice(-9) : id;
return Array
.from(id, Number)
.reduce((counter, digit, i) => {
@JosiasSena
JosiasSena / DeCryptor.java
Last active September 12, 2023 12:40
Encryptor and Decryptor for data encryption.decryption using the Android KeyStore.
/**
_____ _____ _
| __ \ / ____| | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__|
| |__| | __/ |____| | | |_| | |_) | || (_) | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_|
__/ | |
|___/|_|
*/
@gfreivasc
gfreivasc / BackgroundService.java
Last active July 7, 2022 06:05
A BackgroundService class for Android
package com.gabrielfv.android.engine;
import android.app.Service;
import android.content.Intent;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;