Skip to content

Instantly share code, notes, and snippets.

View avipars's full-sized avatar
🎯
Focusing

Avi Parshan avipars

🎯
Focusing
View GitHub Profile
@vjeranc
vjeranc / penrose-tiling.frag
Last active December 17, 2023 06:08
Fragment shader tiling the Las Vegas sphere in Penrose https://whenistheweekend.com/theSphere.html
#define phi 1.61803398874989484820
#define h 1.53884176858762670128
uniform float time;
varying vec2 vUv;
varying vec3 vNormal;
float cx(in vec2 a, in vec2 b) {
return a.x * b.y - a.y * b.x;
}
Home/Core TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
Home/Core (Country Specific) PVMJN-6DFY6-9CCP6-7BKTT-D3WVR
Home/Core (Single Language) 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
Home/Core N 3KHY7-WNT83-DGQKR-F7HPR-844BM
Professional W269N-WFGWX-YVC9B-4J6C9-T83GX
Professional N MH37W-N47XK-V7XM9-C7227-GCQG9
Professional Enterprise
Professional Workstation
Enterprise NPPR9-FWDCX-D2C8J-H872K-2YT43
Enterprise N DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4
@devhammed
devhammed / countries.json
Created October 17, 2020 05:21
Countries with Name, Dial Code, Emoji Flag and ISO Code
[
{
"name": "Afghanistan",
"flag": "🇦🇫",
"code": "AF",
"dial_code": "+93"
},
{
"name": "Åland Islands",
"flag": "🇦🇽",
@sleepyfox
sleepyfox / code_of_cthulhu.md
Last active February 6, 2024 11:42
The Code of Cthulhu

The Code of Cthulhu

I did not invent this, I have extensively searched for the original article but failed to find it, so I'll do my best to reproduce it here.

Imagine a large Enterprise software development company. A bright young programmer joins this company, and in their first few weeks sets about the non-trivial task of understanding the gigantic bloated code base for the company's flagship product.

Finally, the young programmer ascends the dizzy spire of the company's office building and storms into the CTO's gloomy office with a stack of fanfold computer printout, pausing as they become aware of the music playing: a cacophany of crazed flutes and pan-pipes emerging from an audiophile system with a turntable that looks like a medieval orrery and a speaker that bears more than a passing resemblance to the monstrous shell of some long-extinct cephalopod. The music stops, the silence replacing it redolent of some awful finality.

Still full of righteous indignation the programmer angrily declares:

@NickHolcombe
NickHolcombe / ListAdapterWithHeader.kt
Last active October 18, 2023 00:16
Example of a RecyclerView Adapter based on ListAdapter with a header
package example
import android.support.v7.recyclerview.extensions.AsyncDifferConfig
import android.support.v7.recyclerview.extensions.AsyncListDiffer
import android.support.v7.util.DiffUtil
import android.support.v7.util.ListUpdateCallback
import android.support.v7.widget.RecyclerView
/**
* {@link RecyclerView.Adapter RecyclerView.Adapter} base class based on
@martinwicke
martinwicke / automobile.ipynb
Last active January 9, 2022 08:14
Estimator demo using Automobile dataset
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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;
@JosiasSena
JosiasSena / DeCryptor.java
Last active September 12, 2023 12:40
Encryptor and Decryptor for data encryption.decryption using the Android KeyStore.
/**
_____ _____ _
| __ \ / ____| | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__|
| |__| | __/ |____| | | |_| | |_) | || (_) | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_|
__/ | |
|___/|_|
*/
@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) => {