Skip to content

Instantly share code, notes, and snippets.

View Sharkesm's full-sized avatar
:electron:
Midgard Protector

Sharkes Monken Sharkesm

:electron:
Midgard Protector
View GitHub Profile
@edwinlee
edwinlee / Code.gs
Last active February 21, 2024 10:43
Sync a Google Sheets spreadsheet to a Firebase Realtime database
/**
* Copyright 2019 Google LLC.
* SPDX-License-Identifier: Apache-2.0
*/
function getEnvironment() {
var environment = {
spreadsheetID: "<REPLACE WITH YOUR SPREADSHEET ID>",
firebaseUrl: "<REPLACE WITH YOUR REALTIME DB URL>"
};
@simonwuyts
simonwuyts / TooltipView.swift
Last active February 5, 2024 19:28
Customizable Tooltips
//
// TooltipView.swift
// Customizable Tooltips
//
// Copyright © 2017 Simon Wuyts
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@cmoulton
cmoulton / DetailViewController.swift
Last active February 21, 2020 04:20
Using DZNEmptyDataSet in a UIViewController
//
// DetailViewController.swift
// objcInterop
//
// Created by Christina Moulton on 2015-07-02.
// Copyright (c) 2015 Teak Mobile Inc. All rights reserved.
//
import UIKit
import DZNEmptyDataSet
@justinmfischer
justinmfischer / combineDateWithTime
Last active October 6, 2021 13:22
Combine date and time into a single NSDate in Swift 2.0
func combineDateWithTime(date: NSDate, time: NSDate) -> NSDate? {
let calendar = NSCalendar.currentCalendar()
let dateComponents = calendar.components([.Year, .Month, .Day], fromDate: date)
let timeComponents = calendar.components([.Hour, .Minute, .Second], fromDate: time)
let mergedComponments = NSDateComponents()
mergedComponments.year = dateComponents.year
mergedComponments.month = dateComponents.month
mergedComponments.day = dateComponents.day

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos

@minorbug
minorbug / timeago.swift
Created November 7, 2014 15:28
"Time ago" function for Swift (based on MatthewYork's DateTools for Objective-C)
func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String {
let calendar = NSCalendar.currentCalendar()
let unitFlags = NSCalendarUnit.CalendarUnitMinute | NSCalendarUnit.CalendarUnitHour | NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitWeekOfYear | NSCalendarUnit.CalendarUnitMonth | NSCalendarUnit.CalendarUnitYear | NSCalendarUnit.CalendarUnitSecond
let now = NSDate()
let earliest = now.earlierDate(date)
let latest = (earliest == now) ? date : now
let components:NSDateComponents = calendar.components(unitFlags, fromDate: earliest, toDate: latest, options: nil)
if (components.year >= 2) {
return "\(components.year) years ago"
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 5, 2024 18:31
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@rxaviers
rxaviers / gist:7360908
Last active May 5, 2024 15:52
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: