Skip to content

Instantly share code, notes, and snippets.

"use strict";
/**
* Source: {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Status}
* HTTP response status codes indicate whether a specific HTTP request has been successfully completed.
*/
export enum HttpStatusCode {
/**
* The HTTP 100 Continue informational status response code indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.
* To have a server check the request's headers, a client must send Expect: 100-continue as a header in its initial request and receive a 100 Continue status code in response before sending the body.
@Andreyco
Andreyco / gist:8518f2e7e696bab32c9883ae816ab3d6
Created September 27, 2018 21:09
VSCode regex search + group match replace
<res:binder name='facility.(.+?)' />
[[admission.facility.$1]]
@Andreyco
Andreyco / .htaccess
Created March 7, 2016 09:53
Control assets versions via mod_expires
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "modification"
ExpiresByType image/jpeg "modification"
ExpiresByType image/gif "modification"
ExpiresByType image/png "modification"
ExpiresByType text/css "modification"
ExpiresByType application/pdf "modification"
ExpiresByType text/x-javascript "modification"
ExpiresByType application/x-shockwave-flash "modification"
@Andreyco
Andreyco / deepExtend.coffee
Last active August 29, 2015 14:13
Deep object extend
# Check if obj is realy object.
# Note: returns 'false' for 'null'
# (unlike 'typeof null' which returns 'object')
isObject = (obj) ->
type = typeof obj
type is 'function' || type is 'object' && !!obj
# Copy properties from source object
# to target object.
setProperties = (obj, source) ->
@Andreyco
Andreyco / twitter-typeahead
Created May 17, 2014 09:21
Missing Twitter Typeahead style (in Stylus) with variables to quickly adapt to global theme.
// Query input
$tt-typeahead-width = 100%
$tt-query-height = 34px
$tt-query-shadow = inset 0 1px 1px rgba(0,0,0,0.075)
$tt-hint-color = #999
// Dropdown list with data
$tt-dropdown-background = #fefefe
$tt-dropdown-border-radius = 3px
$tt-dropdown-shadow = 0 1px 3px 0 rgba(0,0,0,.2)
// Highlighted suggestion
@Andreyco
Andreyco / [LESS] Positioning mixins
Last active March 10, 2016 09:56
Positioning mixins similar to those ones in Stylus.
/**
* Set positioning properties (top|right|bottom|left).
* @param prop-value. String in format "top 10px".
*/
.positioning-property(@prop-value) {
@property: extract(@prop-value, 1);
@value: extract(@prop-value, 2);
@{property}: @value;
}