Skip to content

Instantly share code, notes, and snippets.

View avipars's full-sized avatar
馃幆
Focusing

Avi avipars

馃幆
Focusing
View GitHub Profile
@avipars
avipars / layout.xml
Created May 4, 2020 17:14
Layout Issues
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/relative"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
@avipars
avipars / vatstyles.css
Created December 31, 2020 12:46
vatstyles.css
@import url("https://fonts.googleapis.com/css?family=Montserrat");
html,
body {
height: 100%;
margin: 0;
padding: 0;
font-family: "Montserrat", sans-serif;
}
@avipars
avipars / weather.yaml
Created February 9, 2021 07:35
HASS Weather notification
service: notify.notify
data:
title: Tomorrow's forecast
message: >-
Expect {{state_attr("weather.home", "forecast")[0].condition}} conditions
with high of {{state_attr("weather.home", "forecast")[0].temperature}}
degrees, and {{state_attr("weather.home", "forecast")[0].humidity}} %
humidity
@avipars
avipars / first.txt
Created February 27, 2021 20:14
Android Medium Articles
Updating data in an Android RecyclerView
Suragch
Suragch
Dec 22, 2018路4 min read
This is a repost of an answer I wrote on Stack Overflow.
There are two main things that I find helpful when exploring a new API: seeing examples (especially ones with pictures) and just trying out all the possibilities. This post will hopefully help you with that as you are learning how to update the adapter data in an Android RecyclerView. If you need help setting up the RecyclerView itself, then see this post or scroll down to the Code section below.
Overview
@avipars
avipars / IP.ps1
Created March 30, 2021 06:58
Powershell detect if current IP is different than your previous one
$uri = "https://whatismyip.host/ip4"
$ipv4 = (Invoke-WebRequest -uri $uri).Content
$currentip = "your.current.public.ip4"
$val = $true
:loop while ($val) {
if($ipv4 -ne $currentip){
Write-Output "not equal - $ipv4 vs $currentip"
@avipars
avipars / script.js
Created September 2, 2021 09:10
Facebook JS automation tool
javascript:
try {
setTimeout(function(){ document.querySelector('[aria-label="Actions for this post"]').click();
}, 1700);
} catch e {
break; // breaks inner-loop only
}
@avipars
avipars / link.ps1
Created September 11, 2021 18:57
Powershell Link Opener
@avipars
avipars / _header
Created September 14, 2021 14:33
CORS for netlify
/*
Access-Control-Allow-Origin: *
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Content-Security-Policy: default-src 'self';script-src https://gc.zgo.at;;default-src 'self';font-src fonts.gstatic.com;style-src 'self' fonts.googleapis.com;frame-ancestors 'self';
@avipars
avipars / button.js
Created October 3, 2021 15:03
JS create button
function createTrends() {
const itemLists = ["microSD Card", "Steak Knife", "ButtonDown Shirts"];
const hebrewLists = ["住讻讬谉 住讟讬讬拽", "讻专讟讬住 讝讬讻专讜谉", "讞讜诇爪讛 诪讻讜驻转专转"];
var hebTerm, mainTerm;
let trend = document.getElementById("trending");
var j = 0;
itemLists.forEach((k) => {
j++;
@avipars
avipars / script.js
Created October 14, 2021 13:06
USEmbassyIsrael Script
javascript: function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
await sleep(3000);
document.querySelector('input[value="Make Appointment!"]').click();
await sleep(3000);
document.querySelector('input[value="AA"]').click();