Skip to content

Instantly share code, notes, and snippets.

View alexey-detr's full-sized avatar
🦉

Alexey Ponomarev alexey-detr

🦉
View GitHub Profile
@samtsai
samtsai / cy-all.ts
Created April 18, 2022 18:22
Typed `cy.all([...])` command for Cypress consumers
// @see https://github.com/cypress-io/cypress/issues/915#issuecomment-475862672
// Modified due to changes to `cy.queue` https://github.com/cypress-io/cypress/pull/17448
// Note: this DOES NOT run Promises in parallel like `Promise.all` due to the nature
// of Cypress promise-like objects and command queue. This only makes it convenient to use the same
// API but runs the commands sequentially.
declare namespace Cypress {
type ChainableValue<T> = T extends Cypress.Chainable<infer V> ? V : T
interface cy {
@yanmhlv
yanmhlv / example.go
Created February 8, 2016 14:49
JSONB in gorm
package main
import (
"database/sql/driver"
"encoding/json"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
)
@evant
evant / code-review
Last active August 2, 2017 11:51
A ruby script to automatically create crucible reviews based on your current branch and youtrack ticket.
#!/usr/bin/env ruby
# A script to create a review on crucible based on the current git branch and
# youtrack ticket.
#
# To configure settings, create a file named .code-review in your home directory
# The format should be:
# ------------------------------------------------------------------------------
# crucible:
# url: <crucible url>
# username: <username>
@codemis
codemis / gist:8225337
Last active November 9, 2021 12:13
A Git pre-commit hook for validating code follows PHP's Fig Coding Standard. The script requires PEAR's Code Sniffer library. Change the variables to fit your project code structure. Just drop this file in your .git/hooks/ directory. This script is a modified file created by Soenke Ruempler.
#!/bin/bash
# PHP CodeSniffer pre-commit hook for git
#
# @author Soenke Ruempler <soenke@ruempler.eu>
# @author Sebastian Kaspari <s.kaspari@googlemail.com>
#
# see the README
PHPCS_BIN=/usr/local/bin/phpcs
PHPCS_CODING_STANDARD=PSR2
@plentz
plentz / nginx.conf
Last active July 17, 2024 09:16
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ismell
ismell / README.md
Last active July 20, 2018 09:52
Ubuntu Upstart Script for Team City

Ubuntu Upstart Script for Team City

  1. Install TeamCity.conf and TeamCityAgent.conf in /etc/init/

  2. Create TeamCity in /etc/default/TeamCity

  3. Make sure TEAMCITY_DATA_PATH and TEAMCITY_SERVER_PATH are owned by www-data

  4. Start TeamCity

     sudo service TeamCity start
    
@tleen
tleen / gist:5109955
Created March 7, 2013 17:30
Format a Javascript Date to RFC-822 datetime using moment.js
var rfc822Date = moment(yourDate).format('ddd, DD MMM YYYY HH:mm:ss ZZ')
@mxswd
mxswd / md2cre.rb
Created July 22, 2012 07:20
Convert Markdown to Creole
#!/usr/bin/env ruby
# Invoke with `ruby md2cre.rb filename.md`
#
# Setup: `gem install redcarpet`
require 'rubygems'
require 'redcarpet'
class Creole < Redcarpet::Render::Base
def normal_text(text)
@doginthehat
doginthehat / gist:1890659
Last active May 12, 2023 20:13
compare block helper for handlebars
// {{compare unicorns ponies operator="<"}}
// I knew it, unicorns are just low-quality ponies!
// {{/compare}}
//
// (defaults to == if operator omitted)
//
// {{equal unicorns ponies }}
// That's amazing, unicorns are actually undercover ponies
// {{/equal}}
// (from http://doginthehat.com.au/2012/02/comparison-block-helper-for-handlebars-templates/)