Skip to content

Instantly share code, notes, and snippets.

View maltzsama's full-sized avatar
💭
Göteborgs

maltzsama

💭
Göteborgs
View GitHub Profile
- (void)trimDiskToDate:(NSDate *)trimDate
{
NSArray *keysSortedByDate = [_dates keysSortedByValueUsingSelector:@selector(compare:)];
for (NSString *key in keysSortedByDate) { // oldest files first
NSDate *accessDate = [_dates objectForKey:key];
if (!accessDate)
continue;
if ([accessDate compare:trimDate] == NSOrderedAscending) { // older than trim date
@maltzsama
maltzsama / gist:5879000
Last active December 19, 2015 01:49
CocoPods install
#1 -Instalação do CocoaPods
[sudo] gem install cocoapods
$ pod setup
#2 Edição do Podfile
$ vim Podfile
#3 Instalação dos pods
$ pod install
platform :io, '5.0'
pod 'JSONKit', '~> 1.4'
pod 'Reachability', '~> 3.0.0'
@maltzsama
maltzsama / gist:6084728
Last active December 20, 2015 06:19
brew not build spidermonkey
$ HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install couchdb 2>&1
==> Installing couchdb dependency: spidermonkey
==> Downloading http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/spidermonkey-1.8.5.tar.gz
tar xf /Library/Caches/Homebrew/spidermonkey-1.8.5.tar.gz
==> ../js/src/configure --prefix=/usr/local/Cellar/spidermonkey/1.8.5 --enable-readline --enable-threadsafe --with-system-nspr
../js/src/configure --prefix=/usr/local/Cellar/spidermonkey/1.8.5 --enable-readline --enable-threadsafe --with-system-nspr
creating cache ./config.cache
checking host system type... x86_64-apple-darwin13.0.0
checking target system type... x86_64-apple-darwin13.0.0
@maltzsama
maltzsama / delayfunc.c
Created December 16, 2013 23:05
teste de delay em microcontroladores PIC
#define DELAY 4
#include <time.h>
#include <stdio.h>
int main(void)
{
time_t begin, end;
end = begin = time(NULL);
printf("blah blah");
@maltzsama
maltzsama / carousel.m
Created December 17, 2013 19:45
iCarousel options
var module = angular.module('SCVerticals');
module.controller('VerticalCtrl', ['$scope', '$modal', 'Verticals',
function ($scope, $modal, Verticals) {
$scope.verticals = Verticals.query();
$scope.deleteVertical = function (vertical) {
Verticals.delete(vertical);
}
@maltzsama
maltzsama / row.html
Last active August 29, 2015 13:55
foundation
<section id="homepage-hero">
<div class="row">
<div class="medium-7 mendium-centered large-6 large-centered columns">
<h1>Foundation</h1><br>
<h3>The most advanced responsive <br class="hide-for-small">front-end framework in the world.</h3>
<br>
</div>
</div>
</section>
@maltzsama
maltzsama / 0_reuse_code.js
Created February 5, 2014 22:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@maltzsama
maltzsama / SCM
Last active August 29, 2015 13:56
SCM message.
#feat : start a new feature code
#ref : reference a production code
#close : close a production code
#bugfix : bug fix
#docs : update docments
#style formatting, missing semi colons, etc; no code change)
#refactor : refactoring production code
#test : (adding missing tests, refactoring tests; no production code change)
#chore : (updating grunt tasks etc; no production code change)