Skip to content

Instantly share code, notes, and snippets.

View phoenixproject's full-sized avatar

phoenixproject phoenixproject

View GitHub Profile
@phoenixproject
phoenixproject / repo-reset.md
Created December 7, 2018 15:37 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@phoenixproject
phoenixproject / leaflet-google.js
Created January 21, 2019 19:21 — forked from crofty/leaflet-google.js
Leaflet plugin that enables the use of Google Map tiles - http://matchingnotes.com/using-google-map-tiles-with-leaflet
/*
* L.TileLayer is used for standard xyz-numbered tile layers.
*/
L.Google = L.Class.extend({
includes: L.Mixin.Events,
options: {
minZoom: 0,
maxZoom: 18,
tileSize: 256,
@phoenixproject
phoenixproject / BaseDao.kt
Created March 15, 2019 17:52 — forked from florina-muntenescu/BaseDao.kt
Use Dao inheritance to reduce the amount of boilerplate code - https://medium.com/google-developers/7-pro-tips-for-room-fbadea4bfbd1
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@phoenixproject
phoenixproject / Decrypt.java
Created September 9, 2019 02:38 — forked from kevinjam/Decrypt.java
RSA Encrypt in PHP and Decrypt in Java or Kotlin
public class DecryptKey {
//before you proceed, you need to ensure your public key is PKCS8 since that is what can be read natively in java.
//If your key begins with-----BEGIN CERTIFICATE-----,
// the it is ssleay and you need to convert it using the openssl command below
//openssl pkcs8 -topk8 -inform pem -in public.key -outform pem -nocrypt -out pkcs8-public-key.pem
//TODO You can you phpsecLib lib but it doesn't support some Library
//opnssl work fine
final private static String RSA_PRIVATE_KEY =
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzTrKt2Y7HqQpt8w379Sl
@phoenixproject
phoenixproject / leaflet-side-by-side.html
Created September 4, 2020 00:14 — forked from DrumMachineLearning/leaflet-side-by-side.html
Demo web app displaying two web maps side by side in sync with each other based on Leaflet
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
This file is licenced CC0 http://creativecommons.org/publicdomain/zero/1.0/
-->
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<title>Leaflet Maps Side by Side</title>
<link rel="stylesheet" href="/javascript/leaflet/leaflet.css" type="text/css" />
<!--[if lte IE 8]><link rel="stylesheet" href="/javascript/leaflet/leaflet.ie.css" /><![endif]-->
<style type="text/css">