Skip to content

Instantly share code, notes, and snippets.

View ro6ley's full-sized avatar
🐼
...typing

Robley Gori ro6ley

🐼
...typing
View GitHub Profile
import time
import urllib.request
l0 = '8b........d8...............................................................................................................88..88....................................................................................................88.....................................................................................88..88.................................................................................................................................88..88..................................................................................................................................88......................................................................................'
l1 = '.Y8,....,8P................................................................................................................88..""....................................................................................................88....................................................................
@passcod
passcod / javascript.json
Created February 24, 2018 04:32
Source (Balsamiq) of the JavaScript Map
{
"mockup": {
"controls": {
"control": [
{
"ID": "1",
"typeID": "Arrow",
"zOrder": "1",
"w": "36",
"h": "109",
FROM node
RUN mkdir -p /usr/src/app
COPY index.js /usr/src/app
EXPOSE 8080
CMD [ "node", "/usr/src/app/index" ]
@dsyer
dsyer / config-props.md
Created November 2, 2017 10:25
Notes on Dynamic Configuration Properties

Dynamic Configuration Properties in Spring Boot and Spring Cloud

TL;DR

  • Use @ConfigurationProperties and always get state from the bean.
  • The Environment can change at runtime and Spring Cloud does this for you using RefreshEvent.
  • Changes are propagated to beans in Spring Cloud in 2 ways (@ConfigurationProperties and @RefreshScope).
  • If you care about the state of @ConfigurationProperties being consistent on concurrent access, put it or the consumer @Bean in @RefreshScope.

Typical Scenarios

@nikneroz
nikneroz / Phoenix JWT.md
Last active October 13, 2019 10:16
Elixir + Phoenix Framework 1.3 + Guardian + JWT(Refresh, Revoke, Recover) + Comeonin

Elixir + Phoenix Framework 1.3 + Guardian + JWT(Refresh, Revoke, Recover) + Comeonin

User model bootstrap

Let's generate User model and controller.

mix ecto.create
mix phoenix.gen.json Accounts User users email:string password_hash:string
@ro6ley
ro6ley / nairobley.zsh-theme
Last active August 11, 2018 12:17
A ZSH theme that is a combination of Steef and Robby Russel
# local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
# PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
function virtualenv_info {
[ $VIRTUAL_ENV ] &&
echo '('%F{blue}`basename $VIRTUAL_ENV`%f') '
}
#use extended color palette if available
if [[ $terminfo[colors] -ge 256 ]]; then
@rolinger
rolinger / gist:d6500d65128db95f004041c2b636753a
Last active April 2, 2024 03:54
PHP => FCM Push notification tutorial for Android and iOS
Below is a full tutorial on how to setup and use Googles Firebase push notification API for both Android and iOS. It is based on this
earlier implementation of Googles GCM method: https://gist.github.com/prime31/5675017 - FCM is the new method and GCM will eventually be
retired.
## THE BELOW METHOD IS THE NEWER FCM METHOD:
Register your app in the FCM Console: https://console.firebase.google.com (add project)
1. Click on the newly added project, in the upper left menu is the "Overview" and Gear Settings.
2. Click on the GEAR settings icon, and then on "Project Settings"
3. In the main screen, click on "Cloud Messaging"
@chrismccord
chrismccord / upgrade.md
Last active April 7, 2023 12:03
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8

To use the new phx.new project generator, you can install the archive with the following command:

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:

@jdeathe
jdeathe / docker-cron-example.md
Last active December 1, 2022 05:01
How to install/run Cron in a Docker Container

How to install/run Cron in a Docker Container

Example crontab entry for testing

  • Append a timestamp to the log file every minute /var/log/cron.
  • Append "tick" and "tock" in alternate minutes to /var/log/cron.
* * * * * /bin/date --rfc-3339=seconds >> /var/log/cron
*/2 * * * * /bin/echo 'tick' >> /var/log/cron
@citrusui
citrusui / fancybutton.md
Last active June 13, 2023 17:58
How to add a fancy Direct Message button to your Tweets https://twitter.com/citrusui/status/719279185123012609

How to add a fancy Direct Message button to your Tweets

Step 1: Go to tweeterid.com and enter your username.

Step 2: Copy your user ID from the previous website.

Step 3: Copy the following URL: