Skip to content

Instantly share code, notes, and snippets.

View meadhikari's full-sized avatar
🏠
Working from home

Bikram Adhikari meadhikari

🏠
Working from home
View GitHub Profile
@meadhikari
meadhikari / post request.java
Created April 12, 2014 19:16
Post request with android
package com.example.httprequest;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;

Dashing dashboard for zabbix trigger

zabbix trigger zabbix trigger

This will provide the total number of alerts on triggers status

  • flash when there's an alert/triggers (color based on the zabbix trigger color format)
  • trigger = Warning, Average, High & Disaster
  • unacknowledge triggers
l = document.links;
for(var i=0; i<l.length; i++) {
l[i].setAttribute("target","_blank")
}
"%20def%20validate(options)%20%0A%20errors%20=%20[]%20%0A%20options%20=%20JSON.parse(options)%20%0A%20%20%0A%20field%20=%20'given_name'%20%20%0A%20root%20=%20'Genevieve'%20%0A%20root%20=%20'%3C%20blank%20%3E'%20if(false)%20%0A%20root%20=%20'Multiple%20Answers'%20if(false)%20%0A%20given_name%20=%20options[:given_name]%20%0A%20errors%20%3C%3C%20%7Bfield:%20field.capitalize,%20input:%20given_name,%20expected:%20root%7D%20unless(%20%22Genevieve%22.strip.downcase.gsub(/%5C./,'').eql?(given_name.to_s.strip.downcase.gsub(/%5C./,''))%20)%20%0A%20errors.to_json%20%0A%20end"
JSON.stringify("%20def%20validate(options)%20%0A%20errors%20=%20[]%20%0A%20options%20=%20JSON.parse(options)%20%0A%20%20%0A%20field%20=%20'given_name'%20%20%0A%20root%20=%20'Genevieve'%20%0A%20root%20=%20'%3C%20blank%20%3E'%20if(false)%20%0A%20root%20=%20'Multiple%20Answers'%20if(false)%20%0A%20given_name%20=%20options[:given_name]%20%0A%20errors%20%3C%3C%20%7Bfield:%20field.capitalize,%20input:%20given_name,%20expected:%20root%7D%20unless(%20%22Genevieve%22.strip.downcase.gsub(/%5C./,'').eql?(given_name.to_s.strip.downcase.gsub(/%5C./,''))%20)%20%0A%20errors.to_json%20%0A%20end")
spotboy: JSON.stringify("%20def%20validate(options)%20%0A%20errors%20=%20[]%20%0A%20options%20=%20JSON.parse(options)%20%0A%20%20%0A%20field%20=%20'given_name'%20%20%0A%20root%20=%20'Genevieve'%20%0A%20root%20=%20'%3C%20blank%20%3E'%20if(false)%20%0A%20root%20=%20'Multiple%20Answers'%20if(false)%20%0A%20given_name%20=%20options[:given_name]%20%0A%20errors%20%3C%3C%20%7Bfield:%20field.capitalize,%20input:%20given_name,%20expected:%20root%7D%20unless(%20%22Genevieve%22.strip.downcase.gsub(/%5C./,'').eql?(given_name.to_s.strip.downcase.gsub(/%5C./,''))%20)%20%0A%20errors.to_json%20%0A%20end")
for (i = 0; i < 5; i++) {
console.log(i);
infowindow1 = new google.maps.InfoWindow({
content: i //access the variable i here
});
}
#curl works fine
#$ curl -d "text=great" http://text-processing.com/api/sentiment/
#returns json
#python is not working
import requests
payload = {"text":"great"}
r = requests.post("http://text-processing.com/api/sentiment/", params=payload)
print r.text
import requests
from dateiterator import daterange
from BeautifulSoup import BeautifulSoup
def dataOf(date):
stockdata = []
postdata = {'Date':date}
r = requests.post("http://www.nepalstock.com/datanepse/previous.php",data=postdata)
content = r.text
soup = BeautifulSoup(content)
@meadhikari
meadhikari / gist:5460813
Last active December 16, 2015 16:09
ead Urls and I download web page content somewhere locally on HDD
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Scanner;