This file contains hidden or 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 | |
source /usr/local/etc/bash_completion.d/git-completion.bash | |
source /usr/local/etc/bash_completion.d/git-flow-completion.bash | |
source /usr/local/etc/bash_completion.d/git-prompt.sh | |
export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256" | |
export CLICOLOR=1 |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#ifdef __APPLE__ | |
#include <OpenCL/opencl.h> | |
#else | |
#include <CL/cl.h> | |
#endif | |
int main() { |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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/bash | |
# run on all nodes | |
# https://docs.docker.com/cs-engine/1.13/ | |
curl -s 'https://sks-keyservers.net/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e' | sudo apt-key add --import | |
sudo apt-get update && sudo apt-get install apt-transport-https | |
sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual | |
echo "deb https://packages.docker.com/1.13/apt/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list | |
sudo apt-get update && sudo apt-get install docker-engine |
This file contains hidden or 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/bash | |
# put this in root/docker_start_master.sh | |
# Make files owned by jenkins (not root). This didn't work when done from the Dockerfile build. | |
chown -R jenkins:jenkins /var/jenkins_home | |
# Need to make sure docker.sock is in the "docker" group so that the "jenkins" user can use it: | |
chown root:docker /var/run/docker.sock | |
# Work-around a problem we're having with the container (running as a UCP service) not having DNS set-up: |
This file contains hidden or 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.util.*; | |
class RpnCalculator { | |
static void main(String[] args) { | |
Calculator calc = new Calculator() | |
'4 6 3 + 9 3 - * 1 1 ^ - +'.split(' ').each {calc.enter(it)} | |
} | |
} | |
class Calculator { |
This file contains hidden or 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
class ReverseNumberArray { | |
static void main(String[] args) { | |
int[] arr = [1, 2, 3, 4, 5, 6, 7, 8, 9] | |
println "original: $arr" | |
println "reversed: ${reverse(arr, 0, arr.size() - 1)}" | |
} | |
static int[] reverse(int[] arr, int left, int right) { | |
int temp = arr[right] | |
arr[right] = arr[left] |
This file contains hidden or 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
class ReverseArray { | |
/* | |
Input: str = "a,b$c" | |
Output: str = "c,b$a" | |
Note that $ and , are not moved anywhere. | |
Only subsequence "abc" is reversed | |
Input: str = "Ab,c,de!$" | |
Output: str = "ed,c,bA!$" | |
*/ |
This file contains hidden or 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.util.regex.Matcher | |
class Palindrome { | |
static void main(String[] args) { | |
def stuff = 'This, stuff ala ffuts, is a sentence to isPalindrome (tacocat)!!ONE!1!' | |
findPalindromes(stuff, true, true) | |
println '==================' | |
findPalindromes(stuff, true, true, true) | |
println '==================' | |
findPalindromes(stuff, false, true) |
This file contains hidden or 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
class FizzBuzz { | |
static void main(String[] args) { | |
(1..100).each {println((it % 3 ? '' : 'fizz') + (it % 5 ? '' : 'buzz') ?: it)} | |
} | |
} |
OlderNewer