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 (1==1) @if(1==0) @ELSE | |
@echo off | |
@SETLOCAL ENABLEEXTENSIONS | |
:: CHECK IF WE NEED TO MODIFY PATH | |
ECHO ;%PATH%; | find /C /I ";%~dp0tools\phantomjs;" > NUL | |
IF %ERRORLEVEL% GTR 0 ( | |
ECHO Adding phantom and casper to PATH | |
SET "path=%path%;%~dp0tools\phantomjs;%~dp0tools\casperjs\batchbin" | |
) | |
:: EXECUTE AFTER REPARSING BATCH INPUT |
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
@ECHO OFF | |
SET targetdir=%~dp0 | |
SET CLASSPATH=%CLASSPATH%;%~dp0tools\lib;%~dp0\tools\apache-ant-1.9.2\lib\ant-launcher.jar | |
ECHO java -Dant.home=tools\apache-ant-1.9.2 org.apache.tools.ant.launch.Launcher -f "%~dp0tools\run-tests.xml" | |
java -Dant.home=tools\apache-ant-1.9.2 org.apache.tools.ant.launch.Launcher -f "%~dp0tools\run-tests.xml" |
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
:: 1) Connect to remote server | |
net use \\fileserver\packages\myproject | |
:: 2) Backup previous package | |
move /y "\\fileserver\packages\myproject\prod\${APP_VERSION}\" "\\fileserver\packages\myproject\prod\${APP_VERSION}.#${releasetag}" | |
if %%errorlevel%% GEQ 1 goto filenotfound | |
goto okay | |
:: 3) Ignore errors | |
:filenotfound |
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"?> | |
<project name="MyProject" default="test-all" basedir="."> | |
<description> | |
******************************************** | |
nant.check-version.xml | |
******************************************** | |
By: Steven de Salas | |
On: November 2015 |
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/bash | |
set -uex | |
cd /tmp | |
# Heroku revision. Must match in 'compile' program. | |
# | |
# Affixed to all vendored binary output to represent changes to the | |
# compilation environment without a change to the upstream version, | |
# e.g. PHP 5.3.27 without, and then subsequently with, libmcrypt. | |
heroku_rev='-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
/* | |
* Queue.h | |
* | |
* Defines a templated (generic) class for a queue of things. | |
* Handy for arduino projects, just #include "Queue.h"; and this file. | |
* | |
* Example Use: | |
* | |
* Queue<char> queue(10); // Max 10 chars in this queue | |
* queue.push('H'); |
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
String.prototype.hashCode = function(){ | |
var hash = 0; | |
if (this.length == 0) return hash; | |
for (var i = 0; i < this.length; i++) { | |
char = this.charCodeAt(i); | |
hash = ((hash<<5)-hash)+char; | |
hash = hash & hash; // Convert to 32bit integer | |
} | |
return hash; | |
} |
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
const http = require('http'); | |
var attempts = 30, complete = 0, delay = 100, | |
url = 'http://domain.com/path/to/entrypoint'; | |
Array(attempts) | |
.fill(0) | |
.forEach((value, index, arr) => setTimeout(() => { | |
var start = new Date().getTime(); | |
http.get(url, function(response) { |
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
// | |
// Observable.js | |
// | |
// Simple JavaScript observable class to inherit from. | |
// Allows for event subscription using .on('event') | |
// | |
// Example: | |
// | |
// let weather = new Observable(); | |
// weather.on('rain', () => person1.wearGumboots()); |
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
# output 10 lines | |
git log --pretty=format:"%h%x09%an%x09%ad%x09%s" --date=short -10 | cat - | |
# copy 10 lines to env variable | |
export GIT_LOG=$(git log --pretty=format:"%h%x09%an%x09%ad%x09%s" --date=short -10 | cat -) | |
# windows (needs testing) | |
for /f %%i in ('git log --date=short -10') do set GIT_LOG=%%i |
OlderNewer