Skip to content

Instantly share code, notes, and snippets.

View rimiti's full-sized avatar
🚀
Focusing

Dimitri DO BAIRRO rimiti

🚀
Focusing
View GitHub Profile

Settting up a Container Registry with docker-gitlab

This should be used for new users to getting started with the container registry feature on docker-gitlab.

Requirements

@rimiti
rimiti / change-commit-date.md
Last active July 16, 2018 08:24
How to change lastest commit date

To change last commit date

GIT_COMMITTER_DATE="`date -R -v-3d`" git commit --amend --no-edit --date "`date -R -v-3d`" && git push
package main
import (
"encoding/json"
"fmt"
"log"
"github.com/graphql-go/graphql"
)
@alexellis
alexellis / async.md
Last active July 30, 2018 21:30
Trying out async FaaS with NATS

You can now evaluate asynchronous functions with FaaS backed by the NATS Streaming server.

  • Checkout the branch and build the image: functions/gateway:latest-dev
$ git clone https://github.com/alexellis/faas
$ git checkout update_async

Optionally also build the branch:

@zbyhoo
zbyhoo / solve_pbxproj_merge_conflict.sh
Created May 5, 2011 09:00
Solving pbxproj files git merge conflicts when two users add files at the same time.
#!/bin/sh
projectfile=`find -d . -name 'project.pbxproj'`
projectdir=`echo *.xcodeproj`
projectfile="${projectdir}/project.pbxproj"
tempfile="${projectdir}/project.pbxproj.out"
savefile="${projectdir}/project.pbxproj.mergesave"
cat $projectfile | grep -v "<<<<<<< HEAD" | grep -v "=======" | grep -v "^>>>>>>> " > $tempfile
cp $projectfile $savefile
const Model = require('sequelize').Model;
class User extends Model {
columns: {
id: {
autoIncrement: true,
primaryKey: true,
type: Model.DataTypes.INTEGER(10)
},
@leymannx
leymannx / Dockerfile
Last active August 8, 2018 00:59 — forked from Majkl578/Dockerfile
[Updated PHP7.0 to PHP 7.1 ] Dockerized example for article at Pehapkari.cz about running multiple PHP versions on NGINX: https://pehapkari.cz/blog/2017/03/27/multiple-php-versions-the-easy-way/
FROM debian:stretch
ENV DEBIAN_FRONTEND noninteractive
# install NGINX
RUN apt-get update && \
apt-get install -y nginx --no-install-recommends && \
rm -rf /var/lib/apt/lists/*
@rimiti
rimiti / upload-to-s3-steam.js
Created November 20, 2018 10:28
NodeJS - Upload local (file) image to AWS S3 from stream with public access.
const AWS = require('aws-sdk');
const fs = require('fs');
AWS.config.update({ accessKeyId: 'ACCESSKEYID', secretAccessKey: 'SECRETACCESSKEY', region: 'eu-west-3'});
const fileStream = fs.createReadStream('/path/to/your/image.png');
fileStream.on('error', function (err) {
if (err) { throw err; }
});
@rimiti
rimiti / index.js
Created April 23, 2019 15:55
Loop: running promises in sequential.
/**
* @description Runs getUser() in sequential.
* @return {Promise<void>}
*/
async function example() {
for (let i = 0; i < 10; i++) {
await getUser();
}
}
@rimiti
rimiti / example.js
Created October 1, 2019 15:39
Javascript: Creating a custom javascript error
export class RequestError extends Error {
constructor(message, meta = {}) {
super();
this.message = message;
this.meta = meta;
}
}