Skip to content

Instantly share code, notes, and snippets.

View gbertb's full-sized avatar

Gilbert Bagaoisan gbertb

View GitHub Profile
@gbertb
gbertb / twittermute.txt
Created January 25, 2020 19:03 — forked from IanColdwater/twittermute.txt
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@gbertb
gbertb / playAudio.swift
Created November 5, 2018 02:54
Play Audio after completing quiz
func playAudio() {
do {
if let fileURL = Bundle.main.path(forResource: "Game Show Win", ofType: "wav") {
audioPlayer = try AVAudioPlayer(contentsOf: URL(fileURLWithPath: fileURL))
audioPlayer?.volume = 0.4
} else {
print("No file with specified name exists")
}
} catch let error {
@gbertb
gbertb / fadeLeft.swift
Created October 26, 2018 20:41
custom fade view transition
// RoommateMatchQuestionViewController.swift
let vc = RoommateMatchQuestionViewController.newInstance()
vc.viewModel = self.viewModel.viewModelForNextQuestion()
let transition = CATransition()
transition.duration = 0.5
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionFade
@gbertb
gbertb / UIView+Hierarchy.swift
Created June 16, 2018 01:09 — forked from myell0w/UIView+Hierarchy.swift
Traverse View Hierarchy Upwards
extension UIView {
func findFirstSuperview<T>(ofClass viewClass: T.Type, where predicate: (T) -> Bool) -> T? where T: UIView {
var view: UIView? = self
while view != nil {
if let typedView = view as? T, predicate(typedView) {
break
}
view = view?.superview
}
@gbertb
gbertb / branch.html
Last active February 12, 2018 21:13
Phone number validation with branch
<html>
<head>
</head>
<body>
<p class="send-instructions">Enter your number and we'll send you a link to download the app</p>
<form id="enter-phone-number" onsubmit="sendBranchLink(this); return false;" class="row">
<div class="large-12 columns">
<div class="row collapse">
<div class="small-7 medium-10 columns">
<input id="phone" type="tel" pattern="^\(?\+?[\d\(\-\s\)]+$" class="input-group-field" placeholder="(408) 219-0093" data-placeholder="">
<script src="https://use.typekit.net/mtj0grj.js"></script>
<script>try{Typekit.load({ async: true });}catch(e){}</script>
<script>
(function(d) {
loadFonts = 1;
if(window.sessionStorage){
if(sessionStorage.getItem('useTypekit')==='false'){
loadFonts = 0;
}

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@gbertb
gbertb / gist:9b35aa4d95ef9a961da10b89e05e64a8
Created August 19, 2017 22:59 — forked from coolaj86/gist:2332953
Dimensions for VistaPrint business cards
Standard
Bleed Margin: 90mm x 52mm
Content Ends: 87mm x 49mm
Imperial
Bleed Margin: 3.54in x 2.05in
Content Ends: 3.43in x 1.93in
@gbertb
gbertb / TooltipView.swift
Created June 10, 2017 19:57 — forked from simonwuyts/TooltipView.swift
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
@gbertb
gbertb / convert id_rsa to pem
Created March 31, 2017 19:01 — forked from mingfang/convert id_rsa to pem
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 700 id_rsa.pem