Skip to content

Instantly share code, notes, and snippets.

View interisti's full-sized avatar
🏠
Working from home

Nikoloz Nikabadze interisti

🏠
Working from home
View GitHub Profile
@teohm
teohm / learn-dynamodb.md
Last active July 31, 2021 09:55
personal reading notes about DynamoDB tips & gotcahs

Disclaimer: I'm super new to DynamoDB, so if you found I wrote something incorrect or stupid, just kindly send me a comment :)


Learn DynamoDB

  • database -> tables -> items -> attributes
  • db = a collection of tables
@branneman
branneman / better-nodejs-require-paths.md
Last active May 15, 2025 11:17
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@renoirb
renoirb / files-ssl.cnf
Last active March 3, 2025 01:02
Creating on a server MySQL configuration. Using those three
[client]
ssl
ssl-ca=/etc/mysql/ca-cert.pem
ssl-cert=/etc/mysql/client-cert.pem
ssl-key=/etc/mysql/client-key.pem
[mysqld]
ssl
ssl-cipher=DHE-RSA-AES256-SHA
ssl-ca=/etc/mysql/ca-cert.pem
@tlack
tlack / gist:2387185
Created April 14, 2012 19:19
express.js / node.js get remote IP address
exports.req_ip = function(req) {
return ( req.headers["X-Forwarded-For"]
|| req.headers["x-forwarded-for"]
|| req.client.remoteAddress );
}
@ramontayag
ramontayag / gist:1336175
Created November 3, 2011 10:01
Kill stuck imagemagick convert processes
#!/usr/bin/env ruby
LIMIT=30 #limit on seconds
PROCESS="convert" #change to process u want to grep
COMMAND="ps -eo pid,cmd,etime"
process_list = `#{COMMAND} | grep #{PROCESS}`
process_list = process_list.split("\n") # make an array of process strings
process_list = process_list.select {|process| process !~ /grep/} # remove the grep process
process_list.each do |process|