Skip to content

Instantly share code, notes, and snippets.

@drale2k
drale2k / gist:e33356df65b715157f9b
Last active February 26, 2017 00:31
Nokogiri update with homebrew paths
# Nokogiri
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.2/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.2/lib --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --use-system-libraries
# PG
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.6/bin/pg_config
// Get current date in ISO 8601 string
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
NSLocale *enUSPOSIXLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
[dateFormatter setLocale:enUSPOSIXLocale];
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"];
NSDate *now = [NSDate date];
NSString *endedAt = [dateFormatter stringFromDate:now];
self.workoutSessionManager.workoutSession.endedAt = endedAt
# render my_response_template.js.erb
respond_to do |format|
format.js { render 'my_response_template', layout: false }
end
{"45" => {"time_slot_ids"=>["1"]}, "46"= >{ "time_slot_ids"=>["1", "2"]}}
// Gets called by notification
-(void)reloadTableView{
[self.tableView reloadData];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[self.workoutSessionManager currentExercises].count -1 inSection:0];
WJSelectExerciseCell *cell = (WJSelectExerciseCell*)[self.tableView cellForRowAtIndexPath:indexPath];
cell.alpha = 0;
cell.transform = CGAffineTransformMakeScale(0.8, 0.8);
[UIView animateWithDuration:0.4 delay:0.35 usingSpringWithDamping:0.7 initialSpringVelocity:1 options:UIViewAnimationOptionCurveEaseInOut animations:^{
2013-11-26 21:02:02.648546|INFO |ServerLibPriv | | TeamSpeak 3 Server 3.0.10.1 (2013-11-08 11:09:56)
2013-11-26 21:02:02.658673|INFO |ServerLibPriv | | SystemInformation: Linux 2.6.18-028stab092.1 #1 SMP Wed Jul 20 19:47:12 MSD 2011 x86_64 Binary: 64bit
2013-11-26 21:02:02.659756|INFO |DatabaseQuery | | dbPlugin name: SQLite3 plugin, Version 2, (c)TeamSpeak Systems GmbH
2013-11-26 21:02:02.659787|INFO |DatabaseQuery | | dbPlugin version: 3.7.3
2013-11-26 21:02:02.660090|INFO |DatabaseQuery | | checking database integrity (may take a while)
2013-11-26 21:02:02.774899|WARNING |Accounting | | Unable to find valid license key, falling back to limited functionality
@drale2k
drale2k / CoreDataTableViewController.h
Created April 10, 2013 22:40
NSFetchedResultsController for UITableViewController
//
// CoreDataTableViewController.h
//
// Created for Stanford CS193p Winter 2013.
// Copyright 2013 Stanford University. All rights reserved.
//
// This class mostly just copies the code from NSFetchedResultsController's documentation page
// into a subclass of UITableViewController.
//
// Just subclass this and set the fetchedResultsController.
{
"id":
92,
"sponsored":
false,
"sponsored_content_url":
"",
"name":
"Schwedenplatz",
"description":
class Etaxi.Views.Videoplayer extends Backbone.View
template: JST['base/videoplayer']
tagName: "div"
id: "overlay-wrapper"
className: "videoplayer"
options:
title: "Video"
Bundler could not find compatible versions for gem "bootstrap-sass":
In Gemfile:
bootstrap-sass (~> 2.0.1) ruby
rails_admin (>= 0) ruby depends on
bootstrap-sass (2.1.0.0)