Skip to content

Instantly share code, notes, and snippets.

View pborreli's full-sized avatar

Pascal Borreli pborreli

View GitHub Profile
@alexellis
alexellis / arm.md
Last active January 4, 2024 23:17
Test swarm connectivity

Regular PC / cloud architecture (64-bit)

See the snippets "guide.md" and "redis.md" below.

Swarm on a Raspberry Pi

If you're wanting to run Docker Swarm on your Raspberry Pi checkout these instructions:

@peterjaap
peterjaap / iterm_open_with
Created December 15, 2016 14:16
Open text files from Iterm2 in PhpStorm by command+clicking on it
#!/bin/sh
# Open text files from Iterm2 in PhpStorm by command+clicking on it
# You will need the Remote call plugin in PhpStorm - https://plugins.jetbrains.com/plugin/6027
# And of course curl
# wget this and chmod +x it
# then move it to somwhere convenient in your path (such as /usr/local/bin)
# With respects to https://gist.github.com/trinitronx/f59a8308d42d71fdba41 for the basis for this
# iterm_open_with - open a URL, file from CWD, full path, or path with linenumber in default app or PhpStorm if text file
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
@lyrixx
lyrixx / post-checkout
Created June 26, 2013 13:37
Git post checkout
#!/bin/bash
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587
PREV_COMMIT=$1
POST_COMMIT=$2
NOCOLOR='\e[0m'
@scrobbleme
scrobbleme / Jenkins - Set shallow clone on Git projects.groovy
Last active August 24, 2017 10:42
This snippets configures all your Jenkins jobs, which use Git as SCM to use shallow clones. This is usefull to save storage and speed up clone. You can execute this scripts with Jenkins build in Groovy console.
import jenkins.model.*
for(item in Jenkins.instance.items) {
if(item.scm instanceof hudson.plugins.git.GitSCM){
println("JOB : "+item.name)
print("useShallowClone: " + item.scm.useShallowClone)
item.scm.useShallowClone=true
println(" => "+item.scm.useShallowClone)
println("\n=======\n")
item.save()
@pborreli
pborreli / YourCommand.php
Last active August 23, 2020 09:48
Show progress of a file download inside Symfony 2.3 console #howto
<?php
protected function execute(InputInterface $input, OutputInterface $output)
{
$progress = $this->getHelperSet()->get('progress');
$ctx = stream_context_create(array(), array('notification' => function ($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max) use ($output, $progress) {
switch ($notification_code) {
case STREAM_NOTIFY_FILE_SIZE_IS:
$progress->start($output, $bytes_max);
break;
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@dbu
dbu / Vagrantfile
Created November 13, 2012 09:26
vagrant setup
# -*- mode: ruby -*-
# vi: set ft=ruby :
this_dir = File.dirname(__FILE__) + "/"
require this_dir + "vagrant/hostmaster.rb"
Vagrant::Config.run do |config|
# define some colors for our output
def colorize(text, color_code) "#{color_code}#{text}\033[0m" end