Skip to content

Instantly share code, notes, and snippets.

View Kuznetsov-Ilia's full-sized avatar
🎯
Focusing

Kuznetsov Ilia Kuznetsov-Ilia

🎯
Focusing
View GitHub Profile
@dabit3
dabit3 / SingleTableAppSync.md
Last active February 24, 2023 20:05
GraphQL Single Table Design with DynamoDB and AWS AppSync

GraphQL

GraphQL Schema

type Customer {
  id: ID!
  email: String!
}
@fospathi
fospathi / svg_matrix_y_flip.txt
Last active August 15, 2022 23:20
SVG matrix to flip the Y-axis direction
The Y-axis in an SVG document points towards the bottom of the page, that is the Y value increases the further down the page
you go. When positioning items in a maths or physics context however it is more appropriate to have the Y-axis pointing up
the page like a normal coordinate system. We can provide an affine transformation matrix to a g element's transform
attribute that flips the Y-axis for its children.
Let the value of the viewBox attribute of the document's SVG element equal "0 0 w h". Suppose we want a coordinate system
whose origin is at the centre of the viewbox and whose Y-axis points up to the top of the page.
(0, 0)
O_ _ _ _ _ _ _ _\ X (Default SVG coordinate system/frame)
@edmondscommerce
edmondscommerce / BASH_function_to_email_via_Gmail_SMTP.bash
Last active August 21, 2018 07:58
BASH function to email via Gmail SMTP
# Bash function to send email via Gmail SMTP
# sendEmail [subject] [toEmail] [message] (optional attachment path)
function sendEmail(){
if (($# < 3 ))
then
echo ""
echo "Usage:"
echo "sendEmail [subject] [toEmail] [message] (optional attachment path)"
echo ""
exit 1
@joeybaker
joeybaker / index.js
Last active November 17, 2016 02:59
css-modules require hook for node. via https://github.com/css-modules/css-modules/issues/13
import setupCSS from './load-css-require.js'
setupCSS(__dirname, (err) => {
if (err) throw err
require('my-front-end-components-that-require-css-files.js')
})
@MoOx
MoOx / position-sticky.js
Created August 6, 2014 14:19
{position: sticky} draft
/**
* Module dependencies
*/
// nothing yet
/**
* Constantes
*/
var PREFIXES = ["webkit", "moz", "ms"]
#!/bin/bash
if [ "$#" -ne "1" ]; then
echo "Usage: $0 package_list"
exit 1
fi
cat $1 | xargs -I {} bash -c "echo {}; brew deps {}" | sort | uniq > /tmp/brew_keep
comm -23 <(brew list -1 | sort) <(cat /tmp/brew_keep) > /tmp/brew_rm
lines=$(cat /tmp/brew_rm | wc -l | sed -e 's/ //g')
@plentz
plentz / nginx.conf
Last active November 16, 2024 14:10
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
@josegonzalez
josegonzalez / access.lua
Created December 3, 2012 18:26
Simple lua file enabling oauth support for nginx via nginx-lua and access_by_lua.
- certain endpoints are always blocked
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then
ngx.exit(403)
end
-- import requirements
local cjson = require "cjson"
-- setup some app-level vars
local app_id = "APP_ID"
@jugyo
jugyo / gist:3882497
Created October 13, 2012 00:16
nginx + ngx_lua on Mac