Skip to content

Instantly share code, notes, and snippets.

//
// ILViewController.h
// ILViewController
//
// Created by ∞ on 07/04/10.
//
// The contents of this file are in the public domain.
#import <UIKit/UIKit.h>
//
// MvrInertia.h
// Mover-iPad
//
// Created by ∞ on 30/03/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
// somethign in here is broken
- (void)layoutSubviews {
[super layoutSubviews];
self.textLabel.frame = CGRectInset(self.contentView.bounds, kHPadding, kVPadding);
BrandTableItem* item = self.object;
@CVertex
CVertex / convert_tabs_to_spaces_and_strip_whitespace
Created May 20, 2011 15:03
Convert Tabs to Spaces and strip whitespaces - Text Mate Command
#!/usr/bin/env ruby
STDIN.read.each do |line|
line.sub!(/^(\t+)/) { |c| ' ' * c.length }
line.sub!(/(\s+)$/, "\n")
puts line
end
class Time
def to_js # to javascript, ie: "2007-06-09T14:23:11+0000", usage: new Date("<%= Time.now.to_js %>")
self.strftime("%Y-%m-%dT%H:%M:%S")
end
end
@CVertex
CVertex / gist:1064551
Created July 5, 2011 09:31
My first go at a SGD user
import java.util.ArrayList;
import org.apache.mahout.classifier.sgd.AdaptiveLogisticRegression;
import org.apache.mahout.classifier.sgd.L1;
import org.apache.mahout.classifier.sgd.L2;
import org.apache.mahout.classifier.sgd.OnlineLogisticRegression;
import org.apache.mahout.math.RandomAccessSparseVector;
import org.apache.mahout.math.Vector;
import org.apache.mahout.vectorizer.encoders.TextValueEncoder;
@CVertex
CVertex / thumbnail_pdf_pages
Created October 17, 2011 14:45
ImageMagick: Convert PDF to Images
convert -density 150 -quality 100 -resize 800x "file.pdf" "result.jpg"
@CVertex
CVertex / IPSWs for iOS Devices
Created October 17, 2011 15:35
IPSWs for iOS Devices
From guy I worked with:
http://www.felixbruns.de/iPod/firmware/
“You can’t downgrade to iOS4.0 once you’ve upgraded to iOS4.1 so be careful.”
@CVertex
CVertex / gist:1870825
Created February 20, 2012 19:15
Subversion backup and restore using svnadmin
SVN repository backup and restore
Simplest way to backup & restore SVN repository:
SVN backup:
svnadmin dump "C:\SvnData\MyProject" > "C:\BackupMyProject.dump"
SVN restore (to new empty repository):
svnadmin load "C:\SvnData\MyProject2" < "C:\BackupMyProject.dump"
@CVertex
CVertex / SampleVC.m
Created December 9, 2012 01:54
WTF: ios6 PresentViewController:animated:completion is offset
// The presenting view controller method
- (void)showMyModal {
NSLog(@"is landscape : %d",UIInterfaceOrientationIsLandscape(self.interfaceOrientation)); // prints 'YES'
UIViewController* lvc = [[SampleViewController alloc] initWithNibName:nil bundle:nil];
self.modalNavController =[[UINavigationController alloc] initWithRootViewController:lvc];
self.modalNavController.modalPresentationStyle = UIModalPresentationFormSheet;
self.modalNavController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;