Skip to content

Instantly share code, notes, and snippets.

View miloskroulik's full-sized avatar

Miloš Kroulík miloskroulik

View GitHub Profile
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 7, 2024 07:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@gimoya
gimoya / QGIS with Bergfex Tile Source
Last active December 22, 2015 09:19
This script can be used with the QGIS OpenLayers Plugin to get tiles from Bergfex (= OEK 50, Austrian topographic map). See here: [http://gis.stackexchange.com/questions/70648/using-custom-source-for-qgis-openlayers-plugin] and here: [http://gis.stackexchange.com/questions/69907/easiest-way-to-create-historical-street-maps-using-qgis] for refere…
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Bergfex Topo Layer</title>
<link rel="stylesheet" href="qgis.css" type="text/css">
<script src="OpenLayers.js"></script>
<script src="OlOverviewMarker.js"></script>
<script type="text/javascript">
var map;
var loadEnd;
var oloMarker; // OpenLayer Overview Marker
@kohnmd
kohnmd / flatten.php
Last active September 20, 2021 12:48
Function to recursively flatten multidimensional PHP array.
<?php
// Requires PHP 5.3+
// Found here: http://stackoverflow.com/a/1320156
function flatten_array(array $array) {
$flattened_array = array();
array_walk_recursive($array, function($a) use (&$flattened_array) { $flattened_array[] = $a; });
return $flattened_array;
}
@AkshayKalose
AkshayKalose / ajax_example.info.yml
Last active November 23, 2022 13:40
Drupal 8 - Ajax Example
name: 'Ajax Example'
description: 'Just an Ajax Example'
core: 8.x
type: module
@miloskroulik
miloskroulik / move_to_parent.sh
Last active August 29, 2015 14:14
Move all directories and files (including hidden ones to parent directory #bash #linux #unix
# You could turn on dotglob:
shopt -s dotglob # This would cause mv below to match hidden files
mv /path/subfolder/* /path/
# In order to turn off dotglob, you'd need to say:
shopt -u dotglob
@leymannx
leymannx / gulpfile.js
Last active July 13, 2023 15:29
Gulp Sass with autoprefixer and minify.
var gulp = require('gulp'),
sass = require('gulp-sass'),
rename = require('gulp-rename'),
cssmin = require('gulp-cssnano'),
prefix = require('gulp-autoprefixer'),
plumber = require('gulp-plumber'),
notify = require('gulp-notify'),
sassLint = require('gulp-sass-lint'),
sourcemaps = require('gulp-sourcemaps');
// Temporary solution until gulp 4
@samuelsolis
samuelsolis / Form.php
Last active October 26, 2022 18:52
Change Field value in drupal 8 form with Ajax
<?php
/**
* Form controller for the bb_report entity edit forms.
*
* @ingroup report
*/
class FeeForm extends ContentEntityForm {
/**
* {@inheritdoc}
@crittermike
crittermike / MyCustomBlock.php
Last active October 23, 2020 17:42
Drupal 8 block with custom cache context and tags
<?php
class MyCustomBlock extends BlockBase {
public function build() {
return array(
'#markup' => $this->t('My custom block content'),
'#cache' => array(
'contexts' => ['url.path'], // https://www.drupal.org/developing/api/8/cache/contexts
'tags' => ['node:1', 'node:2'] // https://www.drupal.org/developing/api/8/cache/tags
),
<?php
namespace Drupal\sitemanager\Plugin;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Core\Config\ConfigFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface;