Skip to content

Instantly share code, notes, and snippets.

View xymor's full-sized avatar

Raphael Miranda xymor

View GitHub Profile
@xymor
xymor / gist:9571659
Last active August 29, 2015 13:57
elasticsearch.yml
cluster.name: "elasticsearch"
path.data: /mnt/elasticsearch/data
path.work: /mnt/elasticsearch/work
path.logs: /mnt/elasticsearch/logs
path.plugins: /mnt/elasticsearch/plugins
http.enabled: true
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["127.0.0.1:[9300-9400]"]
node.master: true
node.data: true
@xymor
xymor / gist:9728719
Created March 23, 2014 19:43
My dsl line is down so I'm tethering my 3G from Vivo carrier in brazil
64 bytes from 74.125.196.104: icmp_seq=183 ttl=40 time=45015.622 ms
64 bytes from 74.125.196.104: icmp_seq=184 ttl=40 time=44225.732 ms
64 bytes from 74.125.196.104: icmp_seq=185 ttl=40 time=43580.101 ms
64 bytes from 74.125.196.104: icmp_seq=186 ttl=40 time=43071.082 ms
64 bytes from 74.125.196.104: icmp_seq=187 ttl=40 time=42308.954 ms
64 bytes from 74.125.196.104: icmp_seq=188 ttl=40 time=41622.076 ms
4 bars...
@xymor
xymor / github-backup.rb
Created May 14, 2014 16:10
Gihub Backup
#gitback 0.1
#credits: Walter White, Updates: Addy Osmani
#!/usr/bin/env ruby
# dependencies
require "yaml"
require "open-uri"
# your github username
username = "addyosmani"
@xymor
xymor / perm.groovy
Created June 22, 2014 02:32
Repenting for my sins
/*
Once upon a time I got an interview with CosmicCart. I had a skype call at 7am but totally forgot about it
and went out drinking the previous night. I got home at 4am very drunk, got up at 6:30 with a killing
hangover and totally flunked that interview.
I finished the 2 element permutation, then he asked me to do the 3 element combination
and I couldn't think straight to solve it.
This is my repentance. I'll get to the n-element method and cleanse my soul.
@xymor
xymor / ComponentTagLib.groovy
Last active August 29, 2015 14:04
Grails CMS
package commerce.catalog.cms
import grails.util.*
class ComponentTagLib {
def storeService, resourceService, groovyPagesTemplateEngine, cacheUtils, grailsApplication, cookieManager
def section = { attrs ->
def store = storeService.getStore()
@xymor
xymor / dump.txt
Created August 18, 2014 22:02
Remembered Networks, it's geekier than taking photos during trips.
defaults read /Library/Preferences/SystemConfiguration/com.apple.airport.preferences RememberedNetworks | grep SSIDString
SSIDString = Waraiotoko;
SSIDString = "MIA-WiFi";
SSIDString = "SFO-WiFi";
SSIDString = "States Together";
SSIDString = "Meteor Guest";
SSIDString = Iacocca;
SSIDString = "Heineken Domes";
SSIDString = RedeWiFiInfraero;
@xymor
xymor / gist:eba54cb2b5234fb03022
Created September 16, 2014 19:53
when you ask a psd slicer to hack some js
if ($('#singleProdInfoBox #parcels-desc').html()){
$('#singleProdInfoBox #parcels-desc').html($('#singleProdInfoBox #parcels-desc').html().replace('até', ''));
}
if ($('#singleProdInfoBox #parcels-desc').html()){
$('#singleProdInfoBox #parcels-desc').html($('#singleProdInfoBox #parcels-desc').html().replace(' x sem', 'x sem'));
}
var x = $('#prc1').html();
x = parseFloat(x);
x = x.toFixed(2);
@xymor
xymor / gist:f77de8ad38388590d26a
Created January 29, 2015 20:18
Python print performance
import sys
import time
x = 1
start_time = time.time()
for l in range(100000):
print x
print time.time() - start_time
@xymor
xymor / mongoid.yml
Created March 21, 2015 23:37
simple mongoid config to use with mongolab env.vars
development:
# Configure available database sessions. (required)
sessions:
# Defines the default session. (required)
default:
# Defines the name of the default database that Mongoid can connect to.
# (required).
database: special_blog_development
# Provides the hosts the default session can connect to. Must be an array
# of host:port pairs. (required)
@xymor
xymor / keybase.md
Created August 8, 2015 21:04
keybase auth

Keybase proof

I hereby claim:

  • I am xymor on github.
  • I am raphaelmiranda (https://keybase.io/raphaelmiranda) on keybase.
  • I have a public key whose fingerprint is 2979 721A F0E7 D4A6 AD76 FDC1 368A 328F 76E4 DFB5

To claim this, I am signing this object: