Skip to content

Instantly share code, notes, and snippets.

View j8's full-sized avatar
💭
I may be slow to respond.

genie j8

💭
I may be slow to respond.
View GitHub Profile
@j8
j8 / gist:3c198c09191d15036eb4
Created September 9, 2015 01:51
nic.io scrapping script
var express = require('express');
var fs = require('fs');
var request = require('request');
var cheerio = require('cheerio');
var app = express();
// Params
var min = 6000;
var max = 10000;
var wordCount = 0;
@j8
j8 / Elasticsearch watermark error fix
Created September 9, 2015 01:50
Elasticsearch set watermark
curl -XPUT localhost:9200/_cluster/settings -d '{
"transient" : {
"cluster.routing.allocation.disk.watermark.low" : "95%",
"cluster.routing.allocation.disk.watermark.high" : "50gb",
"cluster.info.update.interval" : "1m"
}
}'
sudo lsof -iTCP -sTCP:LISTEN -n -P
@j8
j8 / gist:3f9d20e1235f7b00ca58
Created April 7, 2015 19:06
Openshift Set Envorinment Variable
rhc set-env NODE_ENV=development -a alfred
@j8
j8 / line fill animation
Last active August 29, 2015 14:18
SVG line fill animation
'use strict';
angular.module('HireStack').directive('chartLines', ['$location', function($location){
// Runs dursuing compile
return {
// name: '',
// priority: 1,
// terminal: true,
// scope: {}, // {} = isolate, true = child, false/undefined = no change
// controller: function($scope, $element, $attrs, $transclude) {},
@j8
j8 / Openshift push to git
Created March 20, 2015 03:08
Openshift push to git
git push openshift HEAD
@j8
j8 / InstallRestKit IOS
Created March 15, 2015 20:56
Install RestKIT IOS
1
$ sudo gem install cocoapods
And afterwards:
1
$ pod setup
Once Cocoapods is installed, navigate to your project library (still in the terminal) and enter this line:
1
$ pod init
This will integrate Cocoapods into your project, and create, among other things, a file called Podfile which will be used to manage your project’s dependencies.
For more information about Cocoapods and the installation process, you can refer to the Cocoapods homepage, or this tutorial.

Delete the most recent commit:

git reset --hard HEAD~1

Delete the most recent commit, without destroying the work you've done:

git reset --soft HEAD~1

@j8
j8 / OpenShift hot deployment
Created November 16, 2014 11:52
OpenShift update app without restarting
Hot Deployment
Introduction
When the git push command is run to upload code modifications, OpenShift Online stops, builds, deploys, and restarts an application. This entire process takes time to complete and is unnecessary for many types of code changes. With hot deployment the changes to application code are applied without restarting the application cartridge, resulting in increased deployment speed and minimized application downtime.
OpenShift Online provides support for hot deployment through a hot_deploy marker file. If the marker is present, supported application cartridges automatically hot deploy when the git push command is executed.
Enabling and Disabling Hot Deployment
WINDOWS
Enable hot deployment by creating the hot_deploy marker file in the application’s root directory with the following command:
@j8
j8 / gist:b76b4fd55dba027f23de
Created September 22, 2014 01:28
Generate CSR code on OpenShift
http://cloudhostingsource.com/setup-ssl-certificate-openshift/