Skip to content

Instantly share code, notes, and snippets.

import { get, set } from 'lodash';
const remapData = (
from: {[key: string]: any},
remapConfig: { [key: string]: string},
to: {} = {},
) => {
Object.entries(remapConfig).forEach(([fromPath, toPath]) => {
const value = get(from, fromPath, undefined);
version: 2
jobs:
build:
working_directory: ~/attraction-wars-server
docker:
- image: circleci/node:10.0.0
steps:
- checkout
- run:
name: install-npm
@harentius
harentius / Backups.sh
Last active February 10, 2018 20:10
Backups
#!/bin/bash
# Config
target_dir="/home/backupper/backup/"
target_sync_dir="/home/backupper/Dropbox/"
folkprog_assets_base_dir="/home/deploy/projects/folkprog.net/web/assets/"
deploy_others_project_dir="/home/deploy-others/projects/"
nginx_config_dir="/etc/nginx/"
dbs=("folkprog" "mysoul" "gulak" "harry-l")
keep_files_days=60
(function(global, $) {
'use strict';
$(function() {
var $tabToggler, initComments, initialized;
initialized = {
'#vk-comments': false,
'#disqus_thread': false
};
((global, $) ->
'use strict'
$(() ->
initialized = { '#vk-comments': false, '#disqus_thread': false }
initComments = (type) ->
return if initialized[type]
pageUrl = 'page_url'
@harentius
harentius / renderTransition.coffee
Created August 8, 2016 18:59
renderTransition
renderTransition: (text, showingTime = 1500) ->
deferred = new Deferred()
setTimeout(() ->
deferred.resolve()
# displaying code
, showingTime)
return deferred
{
"kind": "customsearch#search",
"url": {
"type": "application/json",
"template": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&cref={cref?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json"
},
"queries": {
"request": [
{
"title": "Google Custom Search - site:johnstonpress.iannounce.mobi/thestarcouk/obituary obituary",
@harentius
harentius / gulpfile.js
Created May 26, 2016 05:54
gulpfile for coffeescript, less, watch and with spec project
var gulp = require('gulp'),
less = require('gulp-less'),
coffee = require('gulp-coffee'),
concat = require('gulp-concat'),
watch = require('gulp-watch'),
batch = require('gulp-batch'),
fs = require('fs'),
argv = require('yargs').argv
;
<!-- Форма -->
<h3>Выбрать нужные дни недели из периода: 01.01.2016 - 31.01.2016</h3>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method = "post">
<label>Пн.<input type="checkbox" name="input[]" value="1"></label>
<label>Вт.<input type="checkbox" name="input[]" value="2"></label>
<label>Ср.<input type="checkbox" name="input[]" value="3"></label>
<label>Чт.<input type="checkbox" name="input[]" value="4"></label>
<label>Пт.<input type="checkbox" name="input[]" value="5"></label>
<button type='submit'>Посчитать количество всех дней</button>
</form> *********************************************************************<br/><br/>
<!-- Форма -->
<h3>Выбрать нужные дни недели из периода: 01.01.2016 - 31.01.2016</h3>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method = "post">
<label>Пн.<input type="checkbox" name="input[]" value="1"></label>
<label>Вт.<input type="checkbox" name="input[]" value="2"></label>
<label>Ср.<input type="checkbox" name="input[]" value="3"></label>
<label>Чт.<input type="checkbox" name="input[]" value="4"></label>
<label>Пт.<input type="checkbox" name="input[]" value="5"></label>
<button type='submit'>Посчитать количество всех дней</button>
</form> *********************************************************************<br/><br/>