Skip to content

Instantly share code, notes, and snippets.

Avatar

Nes 3lvis

View GitHub Profile
View pexip.json
[
{
"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",
View random.json
[
{
"_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",
View 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",
View gist:0536d95518169991d38e08a90b232313
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 Feb 13, 2017 — forked from AliSoftware/GHDiff-HidePods.js
Hide Pods/* related files in a GitHub diff page
View GHDiff-HidePods.js
// 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:
View top100apps.json
{
"feed": {
"author": {
"name": {
"label": "iTunes Store"
},
"uri": {
"label": "http://www.apple.com/itunes/"
}
},
View README.md

Hi!

Description

My goal was to make something somewhat inspired by the Yahoo News Digest app, then I realized that not having pictures could be an issue with the personality of the articles, a simple list of text will look to serious and not fun to read. My approach was to give some life to the list by using different colors based on the index of the article.

Process

View BasicSquares.swift
import UIKit
import XCPlayground
let containerWidth = CGFloat(320)
let containerHeight = CGFloat(568)
//***************************
//***************************
//****** Basic set up *******
//***************************
View drop.swift
public func drop() throws {
guard let store = self.persistentStoreCoordinator.persistentStores.last, storeURL = store.URL, storePath = storeURL.path
else { throw NSError(info: "Persistent store coordinator not found", previousError: nil) }
let sqliteFile = (storePath as NSString).stringByDeletingPathExtension
let fileManager = NSFileManager.defaultManager()
self._writerContext = nil
self._mainContext = nil
self._persistentStoreCoordinator = nil
View helper.swift
class func dataStackWithModelName(modelName: String) -> DATAStack {
let bundle = NSBundle(forClass: Helper.self)
let dataStack = DATAStack(modelName: modelName, bundle: bundle, storeType: .SQLite)
return dataStack
}