This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_ansible_config(managersCount, managersStartNr, workersStartNr) { | |
var createAnsibleString = function(name, startNumber){ | |
return function(a, i) { | |
return name + (i + 1 + (startNumber || 0)) + ' ansible_ssh_host=' + a + ' ansible_ssh_user=ubuntu'; | |
} | |
}; | |
var addresses = $x('//*[@data-ng-if="ip.ip"]/text()') | |
.filter(function(a){return a.wholeText.trim() != ""}) | |
.map(function(a) {return a.wholeText.trim()}); | |
var str = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:2-alpine | |
ENV PYTHONUNBUFFERED=1 \ | |
PROJECT_ROOT=/srv | |
COPY requirements.txt $PROJECT_ROOT/ | |
RUN apk add --update --virtual build-dependencies build-base python-dev \ | |
&& cd $PROJECT_ROOT && pip install -r requirements.txt \ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ContactForm(forms.Form): | |
name = forms.CharField(max_length=60) | |
message = forms.CharField(max_length=200, widget=forms.TextInput) | |
class SubscriptionForm(forms.Form): | |
email = forms.EmailField() | |
want_spam = forms.BooleanField(required=False) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Orignal version taken from http://www.djangosnippets.org/snippets/186/ | |
# Original author: udfalkso | |
# Modified by: Shwagroo Team and Gun.io | |
# Further modified by: Jakub Skalecki (https://rock-it.pl) | |
import hotshot | |
import hotshot.stats | |
import textwrap | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:8 | |
ENV JAVA_OPTS="" | |
WORKDIR /srv | |
COPY snapshot.jar . | |
CMD ["java $JAVA_OPTS -jar snapshot.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
from operator import itemgetter | |
from time import time | |
from binance.client import Client | |
FEE = 0.0005 | |
PRIMARY = ['ETH', 'USDT', 'BTC', 'BNB'] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
DISK="$1" | |
MOUNTPOINT="$2" | |
if [ -z "$DISK" ] || [ -z "$MOUNTPOINT" ]; then | |
echo "Usage: run.sh DISK MOUNTPOINT" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from contextlib import contextmanager | |
from contextvars import ContextVar | |
from functools import wraps, partial | |
_sequential_execution_active = ContextVar('bulk_update_active', False) | |
_sequential_execution_callbacks = ContextVar('bulk_update_callbacks', None) | |
@contextmanager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm -it elixir:1.16 mix run --no-mix-exs -e 'Mix.install(dockerexec: "~> 2.0")' | |
* creating /root/.mix/archives/hex-2.0.6 | |
Resolving Hex dependencies... | |
Resolution completed in 0.01s | |
New: | |
dockerexec 2.0.3 | |
* Getting dockerexec (Hex package) | |
* creating /root/.mix/elixir/1-16/rebar3 | |
===> Fetching rebar3_hex v7.0.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<.flash_group flash={@flash} /> | |
<main> | |
<%= @inner_content %> | |
</main> | |
<%!-- We're doing teleport because navigation is rendered in root layout which is not updated --%> | |
<%!-- Notice "hidden" class, it's important because we're not really teleporting content, but duplicating it --%> | |
<div :if={@current_user} id="onboarding-render" phx-hook="teleport" data-teleport-target="onboarding" class="hidden"> | |
<MyApp.Onboarding.onboarding current_user={@current_user} /> |
OlderNewer