Skip to content

Instantly share code, notes, and snippets.

View kruchai's full-sized avatar
🇺🇦
Be brave like Ukraine

Oleg Kruchai kruchai

🇺🇦
Be brave like Ukraine
View GitHub Profile
@kruchai
kruchai / jsonPuller
Last active June 9, 2021 14:33 — forked from crstamps2/jsonPuller
A Google apps script to pull json from a spreadsheet.
function doGet(){
var ss = SpreadsheetApp.openById("//key ommitted");
return exportJSON(ss);
}
// Exports current sheet as JSON and displays in message box.
function exportJSON(ss) {
var sheet = ss.getSheetByName("sessions");
var rowsData = getRowsData(sheet);
var result = Utilities.jsonStringify(rowsData);
@kruchai
kruchai / sheets.json
Created June 9, 2021 11:05
JSON object exported by the 'Sheets to JSON' Google Sheets addon.
[
[
"Oleg",
"Oleg",
25,
{
"first": 1,
"last": 1
}
]
@kruchai
kruchai / composer.json
Created February 14, 2018 13:36 — forked from andyshinn/composer.json
Docker Compose PHP Composer Example
{
"require": {
"mfacenet/hello-world": "v1.*"
}
}
@kruchai
kruchai / router.html
Created February 6, 2018 13:06 — forked from joakimbeng/router.html
A really simple Javascript router
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Building a router</title>
<script>
// Put John's template engine code here...
(function () {
// A hash to store our routes:
@kruchai
kruchai / Singularitygs + Breakpoint + Compass with Gulp
Created January 26, 2018 13:30
Singularitygs + Breakpoint + Compass with Gulp
This is how I managed to set up Singularitygs + Breakpoint + Compass with Gulp (for Drupal theming).
Install gulp globally
"sudo npm install -g gulp"
Copy the following package.json to the root folder of your project.
{
"name": "your_project",
"version": "1.0.0",
@kruchai
kruchai / composer.txt
Last active December 16, 2017 15:22
MacOS Sierra: How to install Composer globally.
// Detailed description in a comment.
// Just copy the code below.
cd;
curl -s https://getcomposer.org/installer | php;
sudo php installer;
sudo mv composer.phar /usr/local/bin/;
alias composer='/usr/local/bin/composer.phar';
@kruchai
kruchai / bootswatch.txt
Created August 17, 2017 13:03
Improve Bootswatch into Drupal 8 Botstrap 3 sub-theme
First, read the instructions on how to create a Drupal Bootstrap based sub-theme at the official Drupal Bootstrap site.
You can select a Bootswatch from the Bootstrap theme settings, but sometimes you don't want to rely on a third-party for your site.
Here is a quick way of downloading the Bootstrap theme, creating a Bootstrap sub-theme, include a Bootswatch and compile it with less.
You can adjust it to match the path to your site, copy all the lines and run them from your terminal in one go:
cd /var/www/public/example_DEV/themes/;
drush dl bootstrap;
@kruchai
kruchai / settings.local.php
Created January 11, 2017 15:00 — forked from isramv/settings.local.php
Example of D8 settings.local.php
<?php
/**
* @file
* Local development override configuration feature.
*
* To activate this feature, copy and rename it such that its path plus
* filename is 'sites/example.com/settings.local.php', where example.com
* is the name of your site. Then, go to the bottom of
* 'sites/example.com/settings.php' and uncomment the commented lines that
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
@kruchai
kruchai / .vimrc
Created November 11, 2016 14:21 — forked from kaido24/.vimrc
Vim config for Drupal project development
" Allow Vim-only settings even if they break vi keybindings.
set nocompatible
" Enable filetype detection.
filetype off
filetype plugin indent on
" Enable syntax highlighting
if &t_Co > 1
syntax enable