Skip to content

Instantly share code, notes, and snippets.

@lightman76
lightman76 / google_contacts_api.rb
Last active August 8, 2017 10:40
Class to interface with Google Contacts API in Ruby. Adapted from https://gist.github.com/cantino/d1a63045fbfe5fc55a94 . Initialize the class with client which is a hurley client and auth is a Signet::OAuth2::Client - I'm using the versions from the google-api-ruby-client 0.9.x series. Hurley client can be one created straight up or prebuilt fro…
#Adapted from https://gist.github.com/cantino/d1a63045fbfe5fc55a94
module ContactList
class GoogleContactsApi
MAX_RESULTS = "250"
attr_reader :client
def initialize(client, auth)
@client = client
@albertbori
albertbori / HideableUIView.swift
Last active August 9, 2018 10:14
iOS Swift Extension for easily hiding/showing UIViews constrained using Auto Layout
//
// HideableUIView.swift
// Albert Bori
//
// Created by Albert Bori on 5/19/15.
// Copyright (c) 2015 Albert Bori under the MIT license.
// 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 copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active June 17, 2024 06:08
The best FRP iOS resources.

Videos

@bryanluby
bryanluby / gist:548beba8f8062c81ed68
Last active July 28, 2016 14:57
Static variable inside of a function in Swift.
func staticInsideFunction() {
struct Temp { static var hasAnimated = false }
if Temp.hasAnimated == false {
// ... do something only on the first function call.
Temp.hasAnimated = true
} else {
// ... do something on all subsequent function calls.
}
}
@brock
brock / nodereinstall.sh
Last active June 13, 2024 12:20
Complete Node Reinstall. I've moved this to a repo at http://git.io/node-reinstall
#!/bin/bash
# node-reinstall
# credit: http://stackoverflow.com/a/11178106/2083544
## program version
VERSION="0.0.13"
## path prefix
PREFIX="${PREFIX:-/usr/local}"
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@jt
jt / merge.md
Created August 23, 2011 18:47
Merge a forked gist

If someone forks a gist and you'd like to merge their changes. Do this:

  1. clone your repo, I use the name of the gist

     git clone git://gist.github.com/1163142.git gist-1163142
    
  2. add a remote for the forked gist, I'm using the name of my fellow developer

     git remote add aaron git://gist.github.com/1164196.git