Skip to content

Instantly share code, notes, and snippets.

View julien-langlois's full-sized avatar
here and there

Julien Langlois julien-langlois

here and there
View GitHub Profile
@CaptainVincent
CaptainVincent / README.md
Last active February 20, 2025 00:23
Improve your vscode quickinput-widget

Customize your quickinput-widget

This is a small tool designed to emulate the Sublime style Command Palette as follows.

Screenshot

It requires the use of a specific extension to load the js file from this gist.

I'm using the APC extension, and the usage is as follows.

@0xdevalias
0xdevalias / converting-json-to-openapi-swagger-spec.md
Created June 2, 2023 01:09
Exploring tools that allow converting a JSON response automagically into an OpenAPI / Swagger spec.

Converting JSON to OpenAPI / Swagger spec

Exploring tools that allow converting a JSON response automagically into an OpenAPI / Swagger spec.

Test JSON Response

{
    "accounts": {
        "default": {
@drubb
drubb / CacheTimeout.php
Last active January 11, 2023 16:39
Invalidate Drupal cache tags on full hours / at midnight using stack middleware
<?php
namespace Drupal\mymodule\StackMiddleware;
use Drupal\Core\Cache\CacheTagsInvalidator;
use Drupal\Core\Datetime\DateFormatter;
use Drupal\Core\State\State;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;
@RobertKrajewski
RobertKrajewski / mattermost-dl.py
Last active January 27, 2025 12:57
This script allows to export the content (text+files) of an interactively selected Mattermost channel (public, private, group, direct message) to files. Tested on Mattermost 5.27 using Python 3.7
import os
import sqlite3
from datetime import datetime, date
from typing import Tuple, Dict, List
import getpass
from mattermostdriver import Driver
import pathlib
import json
@geerlingguy
geerlingguy / drupal.yml
Last active January 19, 2024 02:15
Drupal in Kubernetes K3s on Raspberry Pi
# This manifest assumes 'drupal' namespace is already present:
#
# kubectl create namespace drupal
#
# Apply the manifest with:
#
# kubectl apply -f drupal.yml
---
kind: ConfigMap
apiVersion: v1
@d-demirci
d-demirci / python-po-translator.py
Created May 28, 2020 10:16
translate po file using google translator with python
#!/usr/env/bin python
from googletrans import Translator
import polib
translator = Translator(service_urls=[
'translate.google.com',
'translate.google.co.kr',
])
#source file
@davlgd
davlgd / pi_soc_monitor.py
Created July 30, 2019 07:02
Raspberry Pi SoC monitoring script
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import csv
import time
delay = 2
csv_file = "pi_soc_results.csv"
@carceneaux
carceneaux / remove_gitlab_artifacts.sh
Last active March 29, 2025 22:48
Script for removing GitLab Job Artifacts.
#!/bin/bash
#
# Written by Chris Arceneaux
# GitHub: https://github.com/carceneaux
# Email: [email protected]
# Website: http://arsano.ninja
#
# Note: This code is a stop-gap to erase Job Artifacts for a project. I HIGHLY recommend you leverage
# "artifacts:expire_in" in your .gitlab-ci.yml
#
@johncrossland
johncrossland / Sphinx_with_Markdown.rst
Created December 12, 2018 00:28
Sphinx with Markdown - How to use Markdown with Sphinx (including Markdown tables that Sphinx does not handle by default for PDF and HTML output)

Sphinx with Markdown walkthrough for HTML and PDF output

This walkthrough installs Sphinx and configures it to output HTML and PDF from .md. If you install it on a VM, allocate over 25GB storage and multiple processors. You'll need Ubuntu 16.04 LTS, an internet connection, and sudo rights.

@alexxxdev
alexxxdev / gist:1dd024cadea091ca64154f9616d5739a
Created August 16, 2018 15:08
remote: fatal: pack exceeds maximum allowed size
# Adjust the following variables as necessary
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=500
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# if so, only push the commits that are not on the remote already
range=$REMOTE/$BRANCH..HEAD
else