Skip to content

Instantly share code, notes, and snippets.

View dmitry-tuzenkov's full-sized avatar
🇳🇱
Focusing

Dmitry Tuzenkov dmitry-tuzenkov

🇳🇱
Focusing
View GitHub Profile
@textarcana
textarcana / git-log2json.sh
Last active July 14, 2024 12:16
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO: https://github.com/context-driven-testing-toolkit/git-log2json
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@facultymatt
facultymatt / roles_invesitgation.md
Last active April 16, 2024 09:31
Roles and permissions system for Nodejs
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@gokulkrishh
gokulkrishh / media-query.css
Last active July 16, 2024 10:52
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@subfuzion
subfuzion / curl.md
Last active July 18, 2024 17:12
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@johntdyer
johntdyer / sendsqs.js
Last active August 2, 2022 13:12
AWS Lambda sample: Send received events to SQS as Message
// PUT YOUR AWS ACCOUNT NUMBER HERE
var AWS_ACCOUNT_ID= '12345';
// PUT YOUR SQS QUEUE NAME HERE
var AWS_SQS_QUEUE_NAME='catch-dlr-dyer-testing';
var QUEUE_URL = 'https://sqs.us-east-1.amazonaws.com/' + AWS_ACCOUNT_ID + '/' + AWS_SQS_QUEUE_NAME;
var AWS = require('aws-sdk');
var sqs = new AWS.SQS({region : 'us-east-1'});
@thornbill
thornbill / .gitlab-ci.yml
Created November 22, 2016 21:29
Example Node GitLab CI Yamlfile
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:6
before_script:
- npm install
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
yup.addMethod(yup.string, 'domain', function pattern(name, message = VALIDATION_ERRORS.domain) {
const domainRules = [patterns.domain, patterns.punycode, patterns.cyrillicDomain];
return this.test({
message,
test: value => (value === null || value === '' || value === undefined) || domainRules.some(regex => regex.test(value)),
});
});