Skip to content

Instantly share code, notes, and snippets.

View landsman's full-sized avatar

Michal Landsman landsman

View GitHub Profile
@maxivak
maxivak / readme.md
Last active April 22, 2025 03:02
Restore repo from Gitlab bundle file

Gitlab exports repositories to tar archive which contains .bundle files.

We have repo.bundle file and we want to restore files from it.

  • create bare repo from bundle file
git clone --mirror myrepo.bundle my.git
@lakshmantgld
lakshmantgld / slackWebhook.md
Last active February 7, 2024 03:57
Configuring slack webhook

A Webhook, in simple terms, is a user-defined HTTP callback. It is a mechanism for the system to notify you about an event. In our case, we need to send messages to a particular channel in slack. Slack calls in Incoming Webhook. It is a mechanism to send messages to your Slack Channel from external sources. These external sources could be any application or service that is capable of sending a JSON payload over HTTP into a Slack Channel. Each Channel will be identified by a unique Incoming Webhook URL to which you can post the message from outside. This configuration is done via the Integrations for your channel.

Steps to create a incoming webhook in Slack:

  1. Naviagte to the Incoming Webhook URL. Click the hyper link incoming webhook integration below the heading Incoming Webhooks.
  2. You will be asked to enter your team URL, followed by your slack credentials.
  3. Once you have completed the above step, you will see the wizard kind of webpage to
@jakubhnilicka
jakubhnilicka / Clear image styles after focal point is set
Created August 18, 2017 09:42
Clear image styles after focal point is set
/**
* Implements hook_entity_presave().
*
* @inheritdoc
*/
function MODULE_NAME_entity_presave(EntityInterface $entity) {
if ($entity instanceof FieldableEntityInterface) {
foreach ($entity->getFieldDefinitions() as $key => $value) {
if ($value->getType() == 'image' && $entity->hasField($value->getName())) {
$image_styles = ImageStyle::loadMultiple();
@duluca
duluca / aws-ecs-deploy-permissions.md
Last active November 8, 2025 11:05
npm scripts for AWS ECS (Blue-Green Deployment)

AWS ECS Deploy Permissions

In order to be able to deploy using the scripts provided by npm scripts for AWS ECS make sure your user is part of an IAM Group that has the following inline policy applied to it.

Note: This may not be complete.

{
    "Version": "2012-10-17",
    "Statement": [
@filipelenfers
filipelenfers / installJdkTarGzUbuntu.sh
Last active September 19, 2025 06:18
Install JDK from tar.gz Ubuntu
#Login as root
sudo su
#create jdk directory
mkdir /opt/jdk
#uncompress, change to your file name
tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk
#check if files are there
@abn
abn / 00-lenovo-x1-5th-gen-thinkfan-setup.md
Last active August 27, 2025 12:08
Fedora thinkfan configuration for Lenovo X1 Carbon (5th Gen)

Thinkfan Configuration Notes

This are notes for configuration thinkfan for Fedora. This configuration procedure was followed on a Lenovo Thinkpad X1 Carbon (5th Gen) running Fedora 25.

Non standard (default) configuration was required for this machine as the default sensors are not available. Eg: /proc/acpi/ibm/thermal does not exist for this model.

An annoted configuration file has been included below. However, there is no guarentee that this will work as-is on every machine.

Installation

dnf -y install thinkfan
@gaborpinterweb
gaborpinterweb / isIE.js
Created June 6, 2017 12:43
Detect IE with JavaScript #ie #edge #js #javascript
// Forked from https://codepen.io/gapcode/pen/vEJNZN
// Get IE or Edge browser version
var version = detectIE();
if (version === false) {
document.getElementById('result').innerHTML = '<s>IE/Edge</s>';
} else if (version >= 12) {
document.getElementById('result').innerHTML = 'Edge ' + version;
} else {
@evantahler
evantahler / buildSitemap.js
Last active December 17, 2020 16:35
35 lines to build a sitemap for next.js projects
#! /usr/bin/env node
// I am ./bin/buildSitemap.js
const path = require('path')
const glob = require('glob')
const fs = require('fs')
const SITE_ROOT = process.env.SITE_ROOT || 'https://www.actionherojs.com'
const SOURCE = process.env.SOURCE || path.join(__dirname, '..', 'pages', '/**/*.js')
const DESTINATION = process.env.DESTINATION || path.join(__dirname, '..', 'static', 'sitemap.xml')
@miloskroulik
miloskroulik / prednaska_prvni_drupal_8_projekt.md
Created April 24, 2017 15:45
K přednášce Moduly, které jsme použili v našem prvním Drupal 8 projektu

Moduly, které jsme použili v našem prvním Drupal 8 projektu

Stručně o projektu

  • portál o zdravotním problému
    • e-shop obohacený o další informace
    • sociální funkce - komentování

Moduly jen pro D8

@porjo
porjo / dump_route53_records.md
Last active February 12, 2025 02:08
Export route53 records to CSV

Retrieve hosted zones with aws route53 list-hosted-zones then enter the zone Id below:

aws route53 list-resource-record-sets --hosted-zone-id "/hostedzone/xxxxxxxxxxx" | \
   jq -r '.ResourceRecordSets[] | [.Name, .Type, (.ResourceRecords[]? | .Value), .AliasTarget.DNSName?]  | @tsv'