Skip to content

Instantly share code, notes, and snippets.

Avatar

Cyril Chandelier cyrilchandelier

View GitHub Profile
@kurtmilam
kurtmilam / slenderize_flatten_javascript_object_.js
Last active Jul 31, 2018
Underscore/Lodash slenderize / flatten object mixin
View slenderize_flatten_javascript_object_.js
/* Copyright (C) 2014 Kurt Milam - http://xioup.com | Source: https://gist.github.com/kurtmilam/7006dc1c2123787f9679
*
* 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.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTI
@snikch
snikch / gist:3661188
Created Sep 6, 2012
Find the current top view controller for your iOS application
View gist:3661188
- (UIViewController *)topViewController{
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController];
}
- (UIViewController *)topViewController:(UIViewController *)rootViewController
{
if (rootViewController.presentedViewController == nil) {
return rootViewController;
}
@nick-desteffen
nick-desteffen / OSX UTC Time Zone
Created Aug 5, 2011
Set Time zone in OSX to UTC
View OSX UTC Time Zone
sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime