Skip to content

Instantly share code, notes, and snippets.

View anorsich's full-sized avatar
👻
Having fun

Andrew Orsich anorsich

👻
Having fun
View GitHub Profile
@anorsich
anorsich / deploy.sh
Last active August 29, 2015 14:06
Deploy node.js app to amazon elasticbeanstalk
APP_NAME="sample"
ENV_NAME="sample-production"
#%build.vcs.number% is sha of commit taken from TeamCity
APP_VERSION=$(date -u +"%%FT%%T-UTC")-${ENV_NAME}-`%build.vcs.number%`
echo APP_VERSION is ${APP_VERSION}
#remove previous build if exists
rm -f appName.zip
@anorsich
anorsich / wait.sh
Created September 8, 2014 09:33
Wait for amazon elastic beanstalk environment become green.
#!/bin/bash
function jsonval {
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop | cut -d":" -f2| sed -e 's/^ *//g' -e 's/ *$//g' `
echo ${temp##*|}
}
echo "Waiting 20 seconds before start checking"
sleep 20s
echo "Press [CTRL+C] to stop.."
@anorsich
anorsich / pr.md
Last active August 29, 2015 14:07 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@anorsich
anorsich / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// Example JS for adding few chats within one application
<script>
var MP = {
data: {
appId: "5ac4cd4289c8710028618d84", // your app id. it's same for each user. required
user: {
username: "UserName1", // required
email: "UserName1@gmail.com", // required
vendorUserId: "UserName1" // unique user id. required
},
@anorsich
anorsich / submit-funnelfly-form.js
Created February 9, 2020 08:18
An example of how to connect any form to Funnelfly.
// Documentation is available here https://docs.funnelfly.com/reference#section-on-form-submit
// The form is: https://www.babypalooza.com/contact-us/
// Form field names is used to get fields and map them to funnelfly fields.
// Funnelfly's custom fields are used to store inquery message, website and type.
<script type="text/javascript">
var form = document.getElementById('hsForm_c7ad58f4-b6df-4b48-bfa6-596cd823dbfd');
funnelfly.onFormSubmit(form, ({
email,