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
// Add a 401 response interceptor | |
window.axios.interceptors.response.use(function (response) { | |
return response; | |
}, function (error) { | |
if (401 === error.response.status) { | |
swal({ | |
title: "Session Expired", | |
text: "Your session has expired. Would you like to be redirected to the login page?", | |
type: "warning", | |
showCancelButton: 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
import java.lang.annotation.Annotation; | |
import java.util.LinkedList; | |
import java.util.List; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.config.BeanDefinition; | |
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider; | |
import org.springframework.core.type.filter.AnnotationTypeFilter; | |
import org.springframework.web.context.support.StandardServletEnvironment; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence xmlns="http://java.sun.com/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence | |
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" | |
version="1.0"> | |
<!-- derby --> |
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
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-jar-plugin</artifactId> | |
<version>2.2</version> | |
<executions> | |
<execution> | |
<configuration> | |
<includes> |
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
require 'rubygems' | |
require 'facter' | |
require 'json' | |
instance_id = Facter::Util::Resolution.exec("ec2-metadata -i | awk '{print $2}'") | |
unless instance_id.nil? | |
region = Facter::Util::Resolution.exec("ec2-metadata -z | awk '{print $2}'") | |
unless region.nil? |
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
Basics | |
:e filename Open filename for edition | |
:w Save file | |
:q Exit Vim | |
:w! Write file and quit | |
Search | |
/word Search word from top to bottom | |
?word Search word from bottom to top |
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
// FROM: http://www.mongodb.org/display/DOCS/Updating#Updating-update%28%29 | |
// | |
// db.collection.update( criteria, objNew, upsert, multi ) | |
// criteria - query which selects the record to update; | |
// objNew - updated object or $ operators (e.g., $inc) which manipulate the object | |
// upsert - if this should be an "upsert"; that is, if the record does not exist, insert it | |
// multi - if all documents matching criteria should be updated | |
// | |
// SQL VERSION: | |
// UPDATE myTable SET dateField = '2011-01-01' WHERE condField = 'condValue' |
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: logs | |
# Puppet-ism to put in the hostname and IP | |
node.name: <%= @hostname %> | |
network.host: <%= @ipaddress %> | |
# Turn off multicast autodiscovery | |
discovery.zen.ping.unicast.hosts: 172.1.1.100:9300, 172.1.1.101:9300 | |
index.number_of_shards: 4 | |
index.routing.allocation.total_shards_per_node: 1 |
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
#!/usr/bin/env ruby | |
require 'net/telnet' | |
cache_dump_limit = 100 | |
localhost = Net::Telnet::new("Host" => "172.16.10.196", "Port" => 11211, "Timeout" => 3) | |
slab_ids = [] | |
localhost.cmd("String" => "stats items", "Match" => /^END/) do |c| | |
matches = c.scan(/STAT items:(\d+):/) | |
slab_ids = matches.flatten.uniq | |
end |
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
# base config | |
base_cache: &base_cache | |
expires: 86400 #session expired after 24 hours | |
servers: | |
- '127.0.0.1:11211' | |
cucumber: | |
<<: *base_cache | |
# local |
NewerOlder