Skip to content

Instantly share code, notes, and snippets.

@rodchile
rodchile / gist:91a419222b9871b1701d
Last active August 29, 2015 14:16
order singly linked list nodes based on value
public class SinglyNode {
public SinglyNode next = null;
public int value;
public SinglyNode(int d)
{
value = d;
}
public static SinglyNode orderNodes(SinglyNode node, int value)
package net.rodrigogarcia.net.Trees;
import java.io.*;
import java.util.*;
public class Solution {
static class Part {
public String getName() { return "X"; }
}
### Keybase proof
I hereby claim:
* I am rodchile on github.
* I am rodchile (https://keybase.io/rodchile) on keybase.
* I have a public key whose fingerprint is F7BF 1FAB A5EF BAD3 D21A C35F 51F9 8C77 5A3F 7177
To claim this, I am signing this object:
@rodchile
rodchile / gist:8289420
Created January 6, 2014 20:34
Script to verify if a given C string is a permutation of other C string
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
char *sortString (char *stringToSort)
{
int stringLenght = strlen(stringToSort);
char *sortedString = strdup(stringToSort);
@rodchile
rodchile / C string reverser
Created January 5, 2014 21:00
Implementing a C string reverser
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
void reverseString (char **str)
{
char *strCopy = *str;
int size = strlen(strCopy) - 1;
#import <QuartzCore/QuartzCore.h>
static long long __color1 = 0x2ACE46;
static long long __color2 = 0x34AADC;
@interface MViewController ()
@property (nonatomic,strong) CALayer *layerColor;
@property (nonatomic,strong) UIColor *color1;
//
// main.c
// first_program
//
// Created by Rodrigo Garcia on 1/18/13.
// Copyright (c) 2013 Rodrigo Garcia. All rights reserved.
//
#include <stdio.h>
@rodchile
rodchile / my singleton Methods
Created February 26, 2012 23:55
Singleton Methods on Ruby
myObject = Object.new
def myObject.sayHello
puts 'Hello from my singleton method! This is me: '
puts self
end
myObject.sayHello
puts "Any doubts? I'm still the same object:"
puts myObject
@rodchile
rodchile / gist:1705475
Created January 30, 2012 17:10
RkRequestQueue
RKClient* requestClient = [RKClient clientWithBaseURL:MBLoginURL];
requestClient.disableCertificateValidation = YES;
RKRequest* theRequest = [requestClient requestWithResourcePath:@"" delegate:self];
[theRequest setHTTPBodyString:httpBody];
[theRequest setMethod:RKRequestMethodPOST];
[theRequest send];
@rodchile
rodchile / gist:1249093
Created September 28, 2011 20:01
Context Values for Test
Map<String,Object> updateValues = new HashedMap();
updateValues.put("pmtDebtorOrgIdentificationOtherId", "String Rut");
updateValues.put("pmtRequestedExecutionDate","String");
updateValues.put("agreementId","String");
updateValues.put("cctPaymentType", "String");
updateValues.put("clientId","String");
updateValues.put("userId", "String");
updateValues.put("trChannel", "String");
updateValues.put("cctStatus","new");
PaymentObjectDTO payObj = new PaymentObjectDTO();