Skip to content

Instantly share code, notes, and snippets.

@soullivaneuh
soullivaneuh / setup.sh
Created Oct 12, 2019
Gitlab runner deploy auto-setup and register
View setup.sh
#!/usr/bin/env bash
set -e
# Usage: bash setup.sh
# This script is supposed to be ran with root user.
# @see https://dockerswarm.rocks/gitlab-ci/
# GitLab runner setup
register_token=${GITLAB_TOKEN:?}
register_host=${GITLAB_HOST:-https://gitlab.com}
runner_image='gitlab/gitlab-runner:latest'
View keybase.md

Keybase proof

I hereby claim:

  • I am soullivaneuh on github.
  • I am soullivaneuh (https://keybase.io/soullivaneuh) on keybase.
  • I have a public key whose fingerprint is 0446 0CD2 28DF 9E0D 42F0 7643 992E B6FA FD4E 6361

To claim this, I am signing this object:

@soullivaneuh
soullivaneuh / index.js
Created Sep 28, 2018
Prevent PageUp and PageDown press in textarea moving website out of the window
View index.js
// @see http://www.competa.com/blog/chrome-bug-pageup-pagedown-textarea-moves-website-window/
// @see https://bugs.chromium.org/p/chromium/issues/detail?id=890248
document.querySelector('textarea').addEventListener('keydown', event => {
if (event.key === 'PageUp' || event.key === 'PageDown') {
const cursorPosition = event.key === 'PageUp' ? 0 : event.target.textLength;
event.preventDefault();
event.target.setSelectionRange(cursorPosition, cursorPosition);
}
});
View Controller.php
/**
* @Route("/for", name="for")
*/
public function forAction(Request $request)
{
return $this->render(
$request->query->has('embed')
? 'default/for_embed.html.twig'
: 'default/for_include.html.twig'
);
View example.html.twig
{% extends 'layout_modal.html.twig' %}
{% trans_default_domain 'front' %}
{% set attr = {
'data-backdrop': 'static',
'data-show': 'true'
} %}
{% block id 'ticket-feedback-modal' %}
@soullivaneuh
soullivaneuh / docker-console
Created Sep 15, 2016
Docker console script sample
View docker-console
#!/usr/bin/env bash
if [ "$#" -ge 1 ]; then
docker exec -u $(whoami) -it project_console_1 "$@"
else
docker exec -u $(whoami) -it project_console_1 bash
fi
@soullivaneuh
soullivaneuh / .styleci.yml
Created Jul 9, 2016
Fixer with options for StyleCI example
View .styleci.yml
enabled:
function_declaration:
single_line: true
@soullivaneuh
soullivaneuh / gist:79b09f030965b2e41305
Created Jan 4, 2016
strace docker-compose gitlab-ci
View gist:79b09f030965b2e41305
$ strace docker-compose up -d
execve("/usr/local/bin/docker-compose", ["docker-compose", "up", "-d"], [/* 26 vars */]) = -1 ENOENT (No such file or directory)
writev(2, [{"strace: exec: No such file or di"..., 39}, {"\n", 1}], 2strace: exec: No such file or directory
) = 40
writev(2, [{"", 0}, {NULL, 0}], 2) = 0
getpid() = 38
exit_group(1) = ?
+++ exited with 1 +++
@soullivaneuh
soullivaneuh / gist:3cee5f17166c856a01fc
Created Jan 4, 2016
ldd docker-compose gitlab-ci
View gist:3cee5f17166c856a01fc
$ ldd /usr/local/bin/docker-compose
/lib64/ld-linux-x86-64.so.2 (0x7fcdef76c000)
libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7fcdef76c000)
libz.so.1 => /lib/libz.so.1 (0x7fcdef556000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fcdef76c000)
View gist:acc9c0ec725f094bcfbd
This file has been truncated, but you can view the full file.
Omnis error ea nam non fuga nihil eos voluptatum voluptate at maxime vel similique sit qui omnis quo beatae quis similique necessitatibus recusandae dolores rerum a facere.
Suscipit aliquam minima exercitationem eius iste eum velit sit necessitatibus ducimus cumque sed laborum.
Nemo autem molestiae eaque temporibus consequatur esse quam deleniti reprehenderit voluptatem adipisci dolor velit.
Voluptatum voluptatum a voluptas iste ea vel sit et consectetur perspiciatis deleniti eveniet et corrupti.
Sed qui atque est fugit eius aut sunt nulla molestias et est nihil quae velit autem.
Non facilis eum eius ex ipsam similique voluptatem quidem alias cupiditate voluptatum dolores perspiciatis sunt.
Facere repellat sint et voluptatem aperiam sit et aliquid ut libero molestiae dolorem eveniet voluptatem ut enim sed unde non.
Placeat sequi perspiciatis eos blanditiis autem dolorem quaerat et repudiandae inventore ut vel unde voluptas laudantium quisquam inventore aspernatur sunt.