An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
[user] | |
name = Pavan Kumar Sunkara | |
email = pavan.sss1991@gmail.com | |
username = pksunkara | |
[init] | |
defaultBranch = master | |
[core] | |
editor = nvim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
pager = delta |
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
/* Copyright 2011 Google */ | |
(function() { | |
var injectionScript = fillInTemplate("(function(){({{$code}})();})();", { | |
code: window.injection.toString() | |
}), | |
injectorScript = fillInTemplate("(function(){({{$code}})();})();", { | |
code: window.injector.toString() | |
}); | |
delete window.injector; | |
delete window.injection; |
#!/usr/bin/env python | |
# coding: utf-8 | |
# You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
# any TTF you have) | |
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
# License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
from image_utils import ImageText |
$.ajax({ | |
type: 'POST', // Use POST with X-HTTP-Method-Override or a straight PUT if appropriate. | |
dataType: 'json', // Set datatype - affects Accept header | |
url: "http://example.com/people/1", // A valid URL | |
headers: {"X-HTTP-Method-Override": "PUT"}, // X-HTTP-Method-Override set to PUT. | |
data: '{"name": "Dave"}' // Some data e.g. Valid JSON as a string | |
}); | |
/* Some clients do not support PUT or it’s difficult to send in a PUT request. For these cases, you could POST the request with a request header of X-HTTP-Method-Override set to PUT. What this tells the server is that the intended request is a PUT. Obviously this relies on the API you are accessing making use of the X-HTTP-Method-Override Header.*/ |
/** | |
* setup JQuery's AJAX methods to setup CSRF token in the request before sending it off. | |
* http://stackoverflow.com/questions/5100539/django-csrf-check-failing-with-an-ajax-post-request | |
*/ | |
function getCookie(name) | |
{ | |
var cookieValue = null; | |
if (document.cookie && document.cookie != '') { | |
var cookies = document.cookie.split(';'); |
<?php | |
/* | |
test.php | |
Proof of concept testing to see if we can get | |
PHP/SOAP talking to EWS. Thanks to Thomas Rabaix | |
for his documentation on NTLM auth in SOAP and to | |
Erik Cederstrand for his article on SOAP/Exchange. |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
#!/bin/bash | |
# Destiny folder where backups are stored | |
DEST=/tmp/bacula/server01 | |
CURRDATE=$(date +"%F") | |
# Hostname where MySQL is running | |
HOSTNAME="srv-mysql" | |
# User name to make backup | |
USER="root" |