Skip to content

Instantly share code, notes, and snippets.

View levent's full-sized avatar

Levent Ali levent

View GitHub Profile
@levent
levent / heroku-deploy.sh
Last active April 6, 2017 12:01
Bash script that checks heroku status before deploying
#!/bin/bash
# Deploy to heroku unless H10 App Crashed
#
# Requires:
# heroku cli
# jq https://stedolan.github.io/jq/
# - brew install jq
# - apt-get install jq
#
{
"config": {
"target": "http://localhost:5000",
"phases": [
{"duration": 5, "arrivalRate": 4}
],
"processor": "./targetModifier.js"
},
"scenarios": [
{
### Keybase proof
I hereby claim:
* I am levent on github.
* I am lebreeze (https://keybase.io/lebreeze) on keybase.
* I have a public key whose fingerprint is B056 B115 9626 ED20 0C33 A910 A455 168C F97D AD49
To claim this, I am signing this object:
@levent
levent / es.sh
Last active December 24, 2015 09:49
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.11.deb
sudo dpkg -i elasticsearch-0.90.11.deb
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.1.deb
sudo dpkg -i elasticsearch-0.90.1.deb
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://d23cj0cdvyoxg0.cloudfront.net/cosmjs-1.0.0.min.js"></script>
<script>..
cosm.setKey( "APIKEY" );
cosm.feed.history(40360, {duration:'30seconds'}, function(data){
console.log(data);
console.log(data.datastreams);
});
</script>
#!/bin/bash
host=`facter fqdn`
if [[ ! -n "$1" ]]; then
port=8000
else
port=$1
fi
echo "http://$host:$port"
<form>
<fieldset>
<legend>Large Form Example</legend>
<div class="row">
<div class="five columns">
<label>Name</label> <input type="text" /> <label>Occupation</label>
<input type="text" /> <label>Twitter</label>
<div class="row collapse">
@levent
levent / cosm-cli
Last active December 11, 2015 14:39
~$ gem in cosm
Fetching: cosm-0.0.7.gem (100%)
Successfully installed cosm-0.0.7
1 gem installed
~$ cosm subscribe -k KEY -f 38997
Subscribing to updates for /feeds/38997
{"status":200,"resource":"/feeds/38997"}
@levent
levent / test_http_clients.rb
Created August 31, 2012 08:39 — forked from jszmajda/test_http_clients.rb
a benchmark to test Net::HTTP, HTTParty, Curb, and system curl
require 'rubygems'
require 'httparty'
require 'curb'
require 'net/http'
require 'benchmark'
include Benchmark
RUNS = 1000
url = 'http://localhost:4567/'