Skip to content

Instantly share code, notes, and snippets.

View jresendiz27's full-sized avatar

Juan Alberto Reséndiz Arteaga jresendiz27

View GitHub Profile
@rponte
rponte / StringUtils.java
Last active April 10, 2024 23:01
Removing accents and special characters in Java: StringUtils.java and StringUtilsTest.java
package br.com.triadworks.rponte.util;
import java.text.Normalizer;
public class StringUtils {
/**
* Remove toda a acentuação da string substituindo por caracteres simples sem acento.
*/
public static String unaccent(String src) {
@leotsem
leotsem / binary_image.html
Created May 7, 2011 14:33
Get binary image data from remote image
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Get binary image data from remote image</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
<script type="text/javascript">
$().ready(function(){
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@stoolrossa
stoolrossa / loadcouchdata.js
Created October 25, 2011 15:29
Loading data from PostGIS into CouchDB
var pg = require('pg'),
cradle = require('cradle');
var pgConnString = 'tcp://spatial:spatial@localhost/spatial';
var couchServer = 'localhost';
var couchPort = 5984;
var couchDatabase = 'spatial';
var couchConn = new cradle.Connection(couchServer, couchPort);
var couchDb = couchConn.database(couchDatabase);
@mresetar
mresetar / readMail.groovy
Created January 29, 2012 15:21
Read e-mail Groovy script
import javax.mail.*;
import javax.mail.internet.*;
@GrabConfig(systemClassLoader=true)
@Grapes(
@Grab(group='javax.mail', module='mail', version='1.4.4')
)
// setup connection
Properties props = new Properties();
def host = "localhost";
@michalbcz
michalbcz / gist:2757676
Created May 20, 2012 11:12
web scraping with groovy (real example with bandzone.cz the czech site promoting amateur czech bands) - all this is cooked with jQuery-like html querying (great Jsoup library), groovy in-house json parsing, emulating ajax requests, working with (malformed
@Grab(group='commons-httpclient', module='commons-httpclient', version='3.1')
import org.apache.commons.httpclient.*
import org.apache.commons.httpclient.methods.GetMethod
import org.apache.commons.httpclient.methods.PostMethod
import org.apache.commons.httpclient.cookie.CookiePolicy
@Grab(group='org.jsoup', module='jsoup', version='1.6.2')
import org.jsoup.Jsoup
import groovy.json.*
@n8agrin
n8agrin / kruskal.js
Created September 5, 2012 02:33
Simple Kruskal's implementation
// See http://en.wikipedia.org/wiki/Kruskal's_algorithm
// and http://programmingpraxis.com/2010/04/06/minimum-spanning-tree-kruskals-algorithm/
var _ = require('underscore');
var nodes = ["A", "B", "C", "D", "E", "F", "G"];
var edges = [
["A", "B", 7], ["A", "D", 5],
@jwebcat
jwebcat / gist:5122366
Last active July 24, 2024 12:11 — forked from lemenkov/gist:1674929
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@visenger
visenger / install_scala_sbt.sh
Last active January 31, 2023 19:10
Scala and sbt installation on ubuntu 12.04
#!/bin/sh
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.4.deb
sudo dpkg -i scala-2.11.4.deb
sudo apt-get update
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 20, 2024 16:44
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\