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
// http://xorswap.com/questions/167-find-the-nth-largest-number-in-an-array | |
function testData() { | |
return [10, 1001, 15, 7, 33, 1001, 2, 0, 99, 131]; | |
}; | |
function sortAsc(a, b) { | |
if(a < b) { | |
return -1; | |
}else if(a === b) { |
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
drawable/app_background.xml: | |
<?xml version="1.0" encoding="utf-8"?> | |
<bitmap xmlns:android="http://schemas.android.com/apk/res/android" | |
android:src="@drawable/actual_pattern_image" | |
android:tileMode="repeat" /> | |
values/styles.xml: | |
<?xml version="1.0" encoding="utf-8"?> | |
<resources> |
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
@Configuration | |
@EnableJpaRepositories(basePackages = "io.eddumelendez.springdatajpa.repository1") | |
public class FirstConfiguration { | |
@ConfigurationProperties(prefix = "datasource.postgres") | |
@Bean | |
@Primary | |
public DataSource postgresDataSource() { | |
return DataSourceBuilder.create(). | |
build(); |
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/node | |
var exec = require('child_process').exec; | |
var connect_status = 'ifconfig | grep tun0 > /dev/null 2>&1 && echo "Connected" || echo "Not connected"'; | |
var show_no_veep = 'zenity --error --text "You are not connected to VPN"' | |
function checkVeep(){ | |
exec(connect_status, function(error, stdout, stderr){ | |
if(stdout.match(/Not/)){ | |
exec(show_no_veep, function(){ | |
setTimeout(checkVeep, 25000); |
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
(function(msg) { | |
return { | |
"hot":function() { | |
console.log(msg); | |
} | |
}; | |
})('doggy').hot(); | |
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
#### | |
# For Centos 7 | |
# iso | |
# https://www.centos.org/download/mirrors/ | |
sudo yum update | |
sudo yum -y install gcc make gcc-c++ kernel-devel-`uname -r` zlib-devel openssl-devel readline-devel sqlite-devel perl wget dkms nfs-utils bzip2 | |
sudo mkdir /mnt/cdv2 | |
sudo mount -r -t iso9660 /dev/sr1 /mnt/cdv2 | |
cd /mnt/cdv2 |
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
#! /bin/sh | |
# ================================================================== | |
# ______ __ _____ | |
# /_ __/___ ____ ___ _________ _/ /_ /__ / | |
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / / | |
# / / / /_/ / / / / / / /__/ /_/ / /_ / / | |
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/ | |
# Multi-instance Apache Tomcat installation with a focus | |
# on best-practices as defined by Apache, SpringSource, and MuleSoft |
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
while test $# -gt 0 | |
do | |
case "$1" in | |
--opt1) echo "option 1" | |
;; | |
--opt2) echo "option 2" | |
;; | |
--*) echo "bad option $1" | |
;; | |
*) echo "argument $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
if [ "$ENV" == "" ] | |
then | |
echo "ENV must be set" | |
exit | |
else | |
echo "ENV is $ENV" | |
fi |
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
# Clone project | |
git clone https://github.com/mhuckaby/retro-post.git rp-eh-1 | |
# Track remote branch | |
git checkout --track origin/ehcache | |
# Branch the remote branch locally | |
git branch ehcache-1 | |
# Push new local branch to remote |
OlderNewer