Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View victor's full-sized avatar
:octocat:
rebasing

Víctor Jalencas victor

:octocat:
rebasing
View GitHub Profile
@victor
victor / hexString.swift
Created October 14, 2015 19:27
Simpler way to obtain a String from a byte array (such as a device token)
import UIKit
let bytes: [UInt8] = [0xDE, 0xAD, 0xBE, 0xEF, 0x42]
let hex = bytes.reduce("", combine: { $0 + String($1, radix:16, uppercase:true) })

Keybase proof

I hereby claim:

  • I am victor on github.
  • I am vicman (https://keybase.io/vicman) on keybase.
  • I have a public key whose fingerprint is 2F0D 7414 5270 C387 E41B 5A47 AA70 C6CC 92BA 3AC6

To claim this, I am signing this object:

@victor
victor / CPTXYPlotSpace.m.diff
Created October 23, 2012 13:51
patch for core plot
diff -r c4b3ac52ecc8 framework/Source/CPTXYPlotSpace.m
--- a/framework/Source/CPTXYPlotSpace.m Wed Oct 03 20:47:35 2012 -0400
+++ b/framework/Source/CPTXYPlotSpace.m Tue Oct 23 15:45:50 2012 +0200
@@ -6,6 +6,7 @@
#import "CPTGraphHostingView.h"
#import "CPTMutablePlotRange.h"
#import "CPTPlot.h"
+#import "CPTBarPlot.h"
#import "CPTPlotArea.h"
#import "CPTPlotArea.h"
@victor
victor / getpatch.sh
Created August 28, 2012 12:03
If you use gerrit for code review, this script may come in handy. Substitute your repository name adequately
#!/bin/sh
PATCH=$1
PATCHSET=$2
URL=ssh://username@server:29418/repository
if [ -z "$PATCHSET" ]; then
PATCHSET=1
fi

NOTE: As long as no project has been selected, I'll call the project XXX.

Demo 1 Working on a team without central repo

NOTE: go drawing on a board as the demo goes.

Step 1 - User 1 - adding to git

The user has already a project so he forget to include it in git so he does it now:

@victor
victor / about.md
Created August 12, 2011 09:51 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
A backup of http://sites.google.com/site/redcodenl/creating-shazam-in-java-1 just in case
Why is this necessary? Read http://sites.google.com/site/redcodenl/patent-infringement
Please fork, tweet about, etc.
----
Creating Shazam in Java
A couple of days ago I encountered this article: How Shazam Works
This got me interested in how a program like Shazam works… And more importantly, how hard is it to program something similar in Java?
NSURLDownload * fileDownload = [[NSURLDownload alloc] initWithRequest:req delegate:self];
if (fileDownload) {
// set destination
[[NSFileManager defaultManager] createDirectoryAtPath:[filename stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:nil error:NULL];
[fileDownload setDestination:filename allowOverwrite:NO];
[fileDownload setDeletesFileUponFailure:NO];
}