Skip to content

Instantly share code, notes, and snippets.

@pushmon
pushmon / node-axios.js
Created November 12, 2019 14:21
Node Axios
// requires axios, install using "npm install axios"
const axios = require('axios');
axios.get('http://pshmn.com/eaFnY')
.then(response => {
console.log(response.data);
}).catch(error => {
console.log(error);
});
@pushmon
pushmon / Jquery
Last active December 3, 2015 23:33
Jquery
$(document).ready(function() {
$.ajax({
url: '${urlstring}',
success: function(data) {
document.write(data);
},
error: function(xhr, status, error) {
document.write(error + ": " + JSON.parse(xhr.responseText));
}
});
@pushmon
pushmon / scala
Last active August 29, 2015 13:58
Scala
<#if filename>
scala_.txt
<#elseif title>
Scala
<#elseif logo>
//dmnv44fd3imdv.cloudfront.net/www.pushmon.com/img/code/java.gif
<#elseif code>
package com.teamextension.ping;
import java.net.URL
@pushmon
pushmon / node
Created April 2, 2014 14:44
Node
<#if filename>
node_.txt
<#elseif title>
Node
<#elseif logo>
@pushmon
pushmon / c
Created April 2, 2014 14:39
C Language
<#if filename>
c_.txt
<#elseif title>
C
<#elseif logo>
//dmnv44fd3imdv.cloudfront.net/www.pushmon.com/img/code/java.gif
<#elseif code>
#include <stdio.h>
#include <curl.h>
@pushmon
pushmon / pushmon.ps1
Created June 5, 2012 07:22
PowerShell
$urlString = "http://pshmn.com/eaFnY"
(new-object System.Net.WebClient).DownloadString($urlString)
@pushmon
pushmon / pushmon.sh
Last active April 4, 2018 13:47
Shell
#!/bin/bash
set -e # if command fails, exit and do not ping
urlstring="http://pshmn.com/eaFnY"
curl -L "${urlstring}"
# if you prefer wget over curl, use
# wget -O - "${urlstring}"
@pushmon
pushmon / gist:1886456
Created February 22, 2012 18:18
JavaScript
<script type='text/javascript' src="http://pshmn.com/eaFnY?type=js"></script>
@pushmon
pushmon / gist:1886446
Created February 22, 2012 18:16
Ruby
require 'net/http'
require 'uri'
urlString = 'http://pshmn.com/eaFnY'
begin
Net::HTTP.get(URI.parse(urlString))
rescue
# log error
end
@pushmon
pushmon / gist:1886432
Created February 22, 2012 18:14
VBScript
On Error Resume Next
Dim http, urlString
urlString = "http://pshmn.com/eaFnY"
Set http = CreateObject("Msxml2.ServerXMLHTTP")
http.Open "GET", urlString
http.Send
Set http = Nothing