Skip to content

Instantly share code, notes, and snippets.

View geritol's full-sized avatar

Gergo Tolnai geritol

View GitHub Profile
@geritol
geritol / renew-letsencrypt-cert-nginx.sh
Last active April 6, 2017 16:43
Renew letsencrypt cert on nginx
sudo service nginx stop
sudo letsencrypt renew
sudo service nginx start
@geritol
geritol / random-string.js
Created April 6, 2017 16:43
Random string js
// random string
// random number - convert it to base 36 (0-9a-z) - remove the '0.' from the beginning
Math.random().toString(36).substr(2)
@geritol
geritol / letter-repeating-string.js
Created August 27, 2017 12:20
js create string with repeating letters
Array(6).join("b") // create string with 5 b-s "bbbbb"
<!-- replace "YOUR_API_KEY" with the API key you obtained from Google -->
<% String googleAPIKey = "YOUR_API_KEY"; %>
<div>
<div id="locationField">
<input id="autocomplete" placeholder="Enter your address" type="text"></input>
</div>
<table id="address">
<!-- replace "YOUR_API_KEY" with the API key you obtained from Google -->
<% String googleAPIKey = "YOUR_API_KEY"; %>
<pega:save name="componentID" ref="Param.pzComponentId" />
<% String componentID = tools.getSaveValue("componentID"); %>
<% String containerID = "address-autocomplete_" + componentID; %>
<div id="<%= containerID %>">
<div id="locationField">
<!-- replace "YOUR_API_KEY" with the API key you obtained from Google -->
<% String googleAPIKey = "YOUR_API_KEY"; %>
<pega:save name="componentID" ref="Param.pzComponentId" />
<% String componentID = tools.getSaveValue("componentID"); %>
<% String containerID = "address-autocomplete_" + componentID; %>
<script>
var unneededElement = document.getElementById('speciality_<%= componentID %>')
<!-- replace "YOUR_API_KEY" with the API key you obtained from Google -->
<% String googleAPIKey = "YOUR_API_KEY"; %>
<pega:save name="componentID" ref="Param.pzComponentId" />
<% String componentID = tools.getSaveValue("componentID"); %>
<% String containerID = "address-autocomplete_" + componentID; %>
<% ClipboardPage primaryPage = tools.getPrimaryPage(); %>
<script>
<!-- replace "YOUR_API_KEY" with the API key you obtained from Google -->
<% String googleAPIKey = "YOUR_API_KEY"; %>
<pega:save name="componentID" ref="Param.pzComponentId" />
<% String componentID = tools.getSaveValue("componentID"); %>
<% String containerID = "address-autocomplete_" + componentID; %>
<% ClipboardPage primaryPage = tools.getPrimaryPage(); %>
<script>
<!-- replace "YOUR_API_KEY" with the API key you obtained from Google -->
<% String googleAPIKey = "YOUR_API_KEY"; %>
<pega:save name="componentID" ref="Param.pzComponentId" />
<% String componentID = tools.getSaveValue("componentID"); %>
<% String containerID = "address-autocomplete_" + componentID; %>
<% ClipboardPage primaryPage = tools.getPrimaryPage(); %>
<script>
@geritol
geritol / recover.py
Last active February 20, 2019 12:29
# Codewars - Recover a secret string from random triplets
import operator
class Node():
def __init__(self, letter):
self.letter = letter
self.followers = set()
self.all_following_nodes = None
def add_follower(self, node):