Skip to content

Instantly share code, notes, and snippets.

@3lvis
3lvis / prettyprint.swift
Last active September 25, 2022 17:58
JSON Pretty Print Swift 5
print(String(data: try! JSONSerialization.data(withJSONObject: dict, options: .prettyPrinted), encoding: .utf8)!)
@3lvis
3lvis / keymap.cson
Last active November 8, 2020 11:18
Xcode keymap for Atom
# Your keymap
#
'body':
'ctrl-tab': 'pane:show-next-item'
'alt-cmd-up': 'pane:split-up'
'alt-cmd-down': 'pane:split-down'
'shift-cmd-L': 'application:open-dev'
'shift-cmd-0': 'window:reset-font-size'
'.platform-darwin':
@3lvis
3lvis / pexip.json
Last active November 1, 2020 09:44
[
{
"id": "5f9e815c8e25c6bf8560cafb",
"start_date": "2020-12-15T11:00:00 -01:00",
"end_date": "2020-12-15T12:00:00 -01:00",
"name": "TOYLETRY",
"friends": [
{
"id": 0,
"name": "Patrick Smith",
@3lvis
3lvis / gist:c3073d99b647a6554b82
Last active October 5, 2019 10:53
OS X Shortcuts
Xcode:
Show Toolbar: Shift + Command + T
Hide Toolbar: Shift + Command + T
Sketch:
Show Toolbar: Shift + Command + T
Hide Toolbar: Shift + Command + T
Show Inspector: Alt(Option) + Command + 0
Show Layers List: Command + 0
[
{
"_id": "5a4f4635c8e945ce7d435ae2",
"index": 0,
"guid": "c39233a4-b90f-4cf4-a759-eb378b7671e6",
"isActive": false,
"balance": "$2,632.67",
"picture": "http://placehold.it/32x32",
"age": 30,
"eyeColor": "blue",
@3lvis
3lvis / discover.json
Created October 2, 2017 09:03
Discover JSON
This file has been truncated, but you can view the full file.
{
"size": 5957,
"items": [
{
"image": {
"scalable": true,
"width": 1600,
"type": "GENERAL",
"url": "2017/9/vertical-5/30/5/105/424/_1263219766.jpg",
"height": 1083
import UIKit
import PlaygroundSupport
class CustomLabel: UILabel {
var topInset: CGFloat = 2.25
var bottomInset: CGFloat = 2.25
override func drawText(in rect: CGRect) {
let insets = UIEdgeInsets(top: topInset, left: 0, bottom: bottomInset, right: 0)
super.drawText(in: UIEdgeInsetsInsetRect(rect, insets))
@3lvis
3lvis / GHDiff-HidePods.js
Last active February 13, 2017 11:41 — forked from AliSoftware/GHDiff-HidePods.js
Hide Pods/* related files in a GitHub diff page
// When you are in the diff page of a GitHub PR
// And want to hide all the Pods/* files in that diff page, use this:
// Paste that in your Web Inspector's console
var nodes = document.evaluate("//div[@class='file-header' and starts-with(@data-path,'Carthage/')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );
for(i=0; i<nodes.snapshotLength; ++i) {
nodes.snapshotItem(i).parentNode.hidden = true
}
// Or even better, create a bookmark with this code for easy quick access:
{
"feed": {
"author": {
"name": {
"label": "iTunes Store"
},
"uri": {
"label": "http://www.apple.com/itunes/"
}
},
export ZSH=/Users/elvis/.oh-my-zsh
ZSH_THEME="robbyrussell"
plugins=(git wd xcode)
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"