Skip to content

Instantly share code, notes, and snippets.

View odedhb's full-sized avatar
🤨

Oded Breiner odedhb

🤨
View GitHub Profile
@odedhb
odedhb / nodeJS-Lightsail.md
Last active December 25, 2022 09:48
nodeJS-Lightsail

Add a Lightsail Instance

Go to https://lightsail.aws.amazon.com/ls/webapp/home/instances
Click “Create instance” button on top right corner
Create Instance:
Instance Location: us-east-1a
Platform: Linux/Unix
Blueprint: Apps +  OS –> Node.js
Instance Plan: select least expensive
@odedhb
odedhb / manifest.json
Created March 25, 2020 09:24
Test PWA manifest icon sizes
{
"short_name": "PWA",
"name": "PWA tester",
"description": "Test PWA manifest",
"icons": [
{
"src": "https://dummyimage.com/72x72/000/fff&text=72",
"type": "image/png",
"sizes": "72x72"
},
@odedhb
odedhb / IP_range_maker.ts
Created December 26, 2016 08:38
Calculates all the IPs in the ranges
/**
* Created by oded on 12/25/16.
*/
export class IPCounter {
static count() {
let converted: string = '';
let ranges = IPCounter.source().split('\n');
ranges.forEach((range) => {
@odedhb
odedhb / calendar.js
Last active October 7, 2016 10:51
calendar.js
var requireFromUrl = require('require-from-url');
requireFromUrl("https://rawgit.com/wanasit/chrono/master/chrono.min.js")
.on('Resolved', function (next, chrono) {
let query = '{QUERY}';
if (!query) return;
let dateResults = chrono.parse(query);
let results = [];
@odedhb
odedhb / PermissionsHelper.java
Last active April 4, 2019 18:02
A simple class for Android Marshmallow. Showing a list of permissions, and allowing the user to change them. This was created to be implemented in http://wheredatapp.com, android's greatest search engine.
package com.nextstagesearch;
import android.Manifest;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
@odedhb
odedhb / WhereDat_app_data_response.json
Created September 20, 2015 08:20
WhereDat app data API response
{
"apps": [
{
"category": "Productivity",
"rating": 4.5,
"updated": 1436741473,
"created": 1431028391,
"icon_url": "https://lh3.googleusercontent.com/q5pFGfXKZejowwcmlJl7M1IXGHVM4Zq_IjPpYb7zgkUFXO3QnZ2LyeOUUhMPaKPkJ3gR=w300",
"title": "WhereDat Beta",
"package": "com.nextstagesearch",
@odedhb
odedhb / WhereDat_app_data_request.json
Last active September 20, 2015 08:21
WhereDat app data request
{
"packages": [
"com.pixmix.mobileapp",
"com.nextstagesearch"
]
}
@odedhb
odedhb / WhereDat_search_response.json
Last active September 20, 2015 08:11
WhereDat Search API response
{
"apps": [
{
"category": "Social",
"rating": 3.9948248863220215,
"updated": 1435805622,
"created": 1427510074,
"icon_url": "https://lh3.googleusercontent.com/ZZPdzvlpK9r_Df9C3M7j1rNRi7hhHRvPhlklJ3lfi5jk86Jd1s0Y5wcQ1QgbVaAP5Q=w300",
"title": "Facebook",
"download_url": "https://play.google.com/store/apps/details?id=com.facebook.katana",
@odedhb
odedhb / WatermarkTransformation.java
Last active June 9, 2018 18:10
Watermark Transformation for the Picasso image loading library (https://github.com/square/picasso). The transformation will add the text you provide in the constructor to the image. This was created to be implemented in http://wheredatapp.com, android's greatest search engine.
package com.nextstagesearch.design;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.support.v7.graphics.Palette;
import com.squareup.picasso.Transformation;
@odedhb
odedhb / EmojiSource.java
Created September 14, 2015 11:36
Emoji source - a helper JAVA class that converts emojis from a json file to a string you can use in android. This was created to be implemented in http://wheredatapp.com, android's greatest search engine.
package com.nextstagesearch.sources;
import android.content.Context;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;