github service hook and basic authentication
I'm trying to figure out how to secure a webhook reciever for a github
service hook.
In the github manual pages, when you look in the section on what IP
addresses github hooks will come from, it has this warning:
"We highly recommend that you don't white list IPs for Service Hooks.
Instead, setup HTTPS and basic authentication to verify incoming
requests."
https://help.github.com/articles/what-ip-addresses-does-github-use-that-i-should-whitelist#service-hook-ip-addresses
In the documentation on post receive hooks I don't see any way to set up
basic authentication.
How can I use basic authentication with github post-recieve/service/web
hook that notifies me of a commit to a repository?
Monday, 19 August 2013
Angularjs ui-router: Rewrite location with default parameter resolved
Angularjs ui-router: Rewrite location with default parameter resolved
I have multiple nested states. Let's say:
departments:
/departments/:idDepartment
departments.group:
/group/:idGroup
departments.group.category:
/category/:idCategory
Each state has a resolve to retrieve his data, prerequisites. BTW, I use
this workaround to use the parent states resolved data in the child states
resolve (https://gist.github.com/MattWalker/6106393)
When the user goes to /processes I redirect him to
/departments//group//category/ so he can see the default department with
the default group and default category. I don't want him to select a
department then a group then a category. I want to show him right away a
view with default values.
It works but here is my question. Once the default values have been found
and the view is shown, how can I have the url location display something
like
/departments/1/group/23/category/2
instead of
/departments//group//category/
Thanks
I have multiple nested states. Let's say:
departments:
/departments/:idDepartment
departments.group:
/group/:idGroup
departments.group.category:
/category/:idCategory
Each state has a resolve to retrieve his data, prerequisites. BTW, I use
this workaround to use the parent states resolved data in the child states
resolve (https://gist.github.com/MattWalker/6106393)
When the user goes to /processes I redirect him to
/departments//group//category/ so he can see the default department with
the default group and default category. I don't want him to select a
department then a group then a category. I want to show him right away a
view with default values.
It works but here is my question. Once the default values have been found
and the view is shown, how can I have the url location display something
like
/departments/1/group/23/category/2
instead of
/departments//group//category/
Thanks
datatables pdf output orientation not working
datatables pdf output orientation not working
I have a really big table with columns exceeding 50. So I want to print
into A2 size output But sPdfOrientation and sPdfSize are not working.
//Button configurations
"aButtons" : [{
"sExtends" : "print",
"sButtonText" : "Print Preview",
"sInfo" : "This is a Print info",
"sMessage" : "This is a print preview. Press 'Esc' to
exit !!!",
"sPdfOrientation": "landscape",
"sPdfSize": "A2"
}, {
"sExtends" : "collection",
"sButtonText" : "Save",
"aButtons" : ["csv", "xls", "pdf"]
}]
I have a really big table with columns exceeding 50. So I want to print
into A2 size output But sPdfOrientation and sPdfSize are not working.
//Button configurations
"aButtons" : [{
"sExtends" : "print",
"sButtonText" : "Print Preview",
"sInfo" : "This is a Print info",
"sMessage" : "This is a print preview. Press 'Esc' to
exit !!!",
"sPdfOrientation": "landscape",
"sPdfSize": "A2"
}, {
"sExtends" : "collection",
"sButtonText" : "Save",
"aButtons" : ["csv", "xls", "pdf"]
}]
Sunday, 18 August 2013
Is parsing XML really this ugly in python?
Is parsing XML really this ugly in python?
I have a very small XML file (22 lines) with 5 elements(?) and I only want
one value out of it.
This is the only way I can get the value I have found without using
regular expressions
from xml.dom.minidom import parse
float(parse(filePath).getElementsByTagName('InfoType')[0].getElementsByTagName('SpecificInfo')[0].firstChild.data)
I feel like I'm missing something. There has to be a more pythonic way to
handle XML, right?
I have a very small XML file (22 lines) with 5 elements(?) and I only want
one value out of it.
This is the only way I can get the value I have found without using
regular expressions
from xml.dom.minidom import parse
float(parse(filePath).getElementsByTagName('InfoType')[0].getElementsByTagName('SpecificInfo')[0].firstChild.data)
I feel like I'm missing something. There has to be a more pythonic way to
handle XML, right?
Any reason to prefer to seed a DB table from 0 rather than from 1?
Any reason to prefer to seed a DB table from 0 rather than from 1?
I'm referring to the simple case when a new DB table is being created with
a unique index column of type Int, and the developer can choose if the
first entry in that identity column is a 0 or a 1.
I'm referring to the simple case when a new DB table is being created with
a unique index column of type Int, and the developer can choose if the
first entry in that identity column is a 0 or a 1.
Limit Scaffold entries to only 1
Limit Scaffold entries to only 1
I Generated a SHOPS SCAFFOLD.
As usually in a scaffold users can create a lot of entries.
How can i limit this so Users can create only ONE Entry ?
Thank you
I Generated a SHOPS SCAFFOLD.
As usually in a scaffold users can create a lot of entries.
How can i limit this so Users can create only ONE Entry ?
Thank you
Why doesn't C++ find template function?
Why doesn't C++ find template function?
Why do I get the compile error no matching function for call to `f(
__gnu_cxx::__normal_iterator > >)'?
#include <vector>
template<typename T>
void f(const typename std::vector<T>::iterator &) {}
void g() {
std::vector<int> v;
f<int>(v.end()); // Compiles.
f(v.end()); // Doesn't compile, gcc 4.3 can't find any match.
}
Ultimately I want to write a function which takes only a vector iterator,
and fails to compile (with a meaningful error) for anything else.
Why do I get the compile error no matching function for call to `f(
__gnu_cxx::__normal_iterator > >)'?
#include <vector>
template<typename T>
void f(const typename std::vector<T>::iterator &) {}
void g() {
std::vector<int> v;
f<int>(v.end()); // Compiles.
f(v.end()); // Doesn't compile, gcc 4.3 can't find any match.
}
Ultimately I want to write a function which takes only a vector iterator,
and fails to compile (with a meaningful error) for anything else.
Subscribe to:
Posts (Atom)