Skip to content

Instantly share code, notes, and snippets.

@sfc-gh-scoombes
sfc-gh-scoombes / snowflake-xmltojson.py
Created April 15, 2021 13:16
Python Lambda to convert XML to JSON
import json
import xmltodict
import decimal, datetime
def default_json_transform(obj):
if isinstance(obj, decimal.Decimal):
return str(obj)
if isinstance(obj, (datetime.date, datetime.datetime)):
return obj.isoformat()
@zhashkevych
zhashkevych / Dockerfile
Last active April 27, 2024 03:37
Wait for Postgres initialization in Docker-Compose
FROM golang:1.14-buster
RUN go version
ENV GOPATH=/
COPY ./ ./
# install psql
RUN apt-get update
RUN apt-get -y install postgresql-client
@takuto-h
takuto-h / Dockerfile.node-gyp
Last active June 23, 2022 06:42
Use node-gyp with node:*-slim
FROM node:10.15.1-slim
COPY ./package.json ./yarn.lock /app/
# Install dependencies for node-gyp
# https://github.com/nodejs/node-gyp#on-unix
RUN buildDeps='g++ make python' \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& cd /app \
@senthilmpro
senthilmpro / download-file-axios-nodejs.js
Last active August 2, 2024 13:33
Download File using axios : Node.js program
'use strict'
const Fs = require('fs')
const Path = require('path')
const Axios = require('axios')
async function downloadImage () {
const url = 'https://unsplash.com/photos/AaEQmoufHLk/download?force=true'
const path = Path.resolve(__dirname, 'images', 'code1.jpg')
@igogrek
igogrek / Cookbook.md
Last active May 29, 2024 02:00
Cookbook

This cookbook is similar to Vue cookbook but contains our custom recipes for some specific cases.

Form validation

For form validation we use Vuelidate

export default Vue.extend({
  ...
 validations: {
@merikan
merikan / Jenkinsfile
Last active September 4, 2025 20:48
Some Jenkinsfile examples
Some Jenkinsfile examples
@claytonrcarter
claytonrcarter / README.md
Last active October 2, 2025 18:31
Bash script to check GitLab pipeline status

A super simple bash script to check the status of a GitLab CI pipeline.

$ git push
...
$ git pipeline-status
Status of last pipeline for user/project on gitlab/master:
"pending"
...
$ git pipeline-status
@luciopaiva
luciopaiva / _Full-socketio-client-and-server-example.md
Last active September 19, 2025 17:23
Full socket.io client and server example

Full socket.io client and server example

Last updated: 2021-02-21, tested with socket.io v3.1.1

This is the simplest implementation you will find for a client/server WebSockets architecture using socket.io.

To see a full explanation, read my answer on SO here: https://stackoverflow.com/a/24232050/778272.

If you're looking for examples using frameworks, check these links:

@laurenfazah
laurenfazah / authentication_with_express_postgres.md
Last active July 13, 2024 16:51
Authentication with an Express API and Postgres

Authentication with an Express API and Postgres

Setting Up

Let's make sure our Express app has the required base modules:

# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon
@sylvaindethier
sylvaindethier / server.js
Created June 26, 2017 09:36
NodeJS Express server for SPA
// Express
const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
const PORT = 9000;
const STATIC = path.resolve(__dirname, 'dist');
const INDEX = path.resolve(STATIC, 'index.html');