This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
x = 1 | |
start_time = time.time() | |
for l in range(100000): | |
print x | |
print time.time() - start_time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package commerce.catalog.cms | |
import grails.util.* | |
class ComponentTagLib { | |
def storeService, resourceService, groovyPagesTemplateEngine, cacheUtils, grailsApplication, cookieManager | |
def section = { attrs -> | |
def store = storeService.getStore() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
keytool -printcert -sslserver secure.fcontrol.com.br -rfc > fcontrol.pem | |
#alternative: openssl s_client -quiet -showcerts -connect secure.fcontrol.com.br:443 | sed -n '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > fcontrol.pem | |
keytool -import -trustcacerts -alias secure.fcontrol.com.br -file fcontrol.pem -keystore /home/raphaelm/projects/git-repos/ideais-kanlo/etc/kanlo2/vmfiles/etc/pki/java/cacerts | |
#list trusted certificates | |
keytool -list -keystore /home/raphaelm/projects/git-repos/ideais-kanlo/etc/kanlo2/vmfiles/etc/pki/java/cacerts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#gitback 0.1 | |
#credits: Walter White, Updates: Addy Osmani | |
#!/usr/bin/env ruby | |
# dependencies | |
require "yaml" | |
require "open-uri" | |
# your github username | |
username = "addyosmani" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Our architecture uses an Ec2:Instance to define a master, | |
such instance doesn't have the automatic management of elb attachment | |
provided by the AWS::AutoScaling::AutoScalingGroup to slaves so | |
this script roughly replicates it by attaching an instance | |
upon boot and releasing it during shutdown. |