Skip to content

Instantly share code, notes, and snippets.

View dariogz's full-sized avatar

Dario Adrian Gonzalez dariogz

View GitHub Profile
@dariogz
dariogz / better-nodejs-require-paths.md
Created February 22, 2022 15:04 — forked from branneman/better-nodejs-require-paths.md
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

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type
@dariogz
dariogz / viewController.swift
Last active April 26, 2017 23:17
Swift 3 Alert Modal (UIAlertController)
// Create Alert
let alert = UIAlertController(title: "Your Title", message: "Your message", preferredStyle: UIAlertControllerStyle.alert)
// Create Action
alert.addAction(UIAlertAction(title: "Your action name", style: UIAlertActionStyle.default, handler: nil))
// Present
self.present(alert, animated: true, completion: nil)
killall ssh-agent; eval `ssh-agent`