Skip to content

Instantly share code, notes, and snippets.

View jaimeiniesta's full-sized avatar

Jaime Iniesta jaimeiniesta

View GitHub Profile
Hello Xxxxx,
Thanks for the offer, but I have to reject it.
Although I know about building web scrapers, I think that automated recruitment is an increasing problem nowadays. My inbox gets spammed weekly by recruiters who got my contact details but didn't take the time to know a bit more about me before sending the email.
I don't feel that building such a tool would make the world a better place, or at least, it could make it a bit worse for me.
Regards,
Jaime
@jaimeiniesta
jaimeiniesta / data.txt
Created February 18, 2014 11:14
MetaInspector example script
******************************************************************
URL: https://github.com/
TITLE: GitHub · Build software better, together.
KEYWORDS:
DESCRIPTION: Build software better, together.
******************************************************************
******************************************************************
URL: https://delicious.com/
TITLE: Delicious
@jaimeiniesta
jaimeiniesta / gist:9739091
Created March 24, 2014 12:18
olark + turbolinks compatibility
function init_olark(c) {var f=window,d=document,l=f.location.protocol=="https:"?"https:":"http:",z=c.name,r="load";var nt=function(){
f[z]=function(){
(a.s=a.s||[]).push(arguments)};var a=f[z]._={
},q=c.methods.length;while(q--){(function(n){f[z][n]=function(){
f[z]("call",n,arguments)}})(c.methods[q])}a.l=c.loader;a.i=nt;a.p={
0:+new Date};a.P=function(u){
a.p[u]=new Date-a.p[0]};function s(){
a.P(r);f[z](r)}f.addEventListener?f.addEventListener(r,s,false):f.attachEvent("on"+r,s);var ld=function(){function p(hd){
hd="head";return["<",hd,"></",hd,"><",i,' onl' + 'oad="var d=',g,";d.getElementsByTagName('head')[0].",j,"(d.",h,"('script')).",k,"='",l,"//",a.l,"'",'"',"></",i,">"].join("")}var i="body",m=d[i];if(!m){
return setTimeout(ld,100)}a.P(1);var j="appendChild",h="createElement",k="src",n=d[h]("div"),v=n[j](d[h](z)),b=d[h]("iframe"),g="document",e="domain",o;n.style.display="none";m.insertBefore(n,m.firstChild).id=z;b.frameBorder="0";b.id=z+"-loader";if(/MSIE[ ]+6/.test(navigator.userAgent)){
@jaimeiniesta
jaimeiniesta / validator_nu_http_response.json
Created March 9, 2015 01:21
Different response validating the same page on web version and java jar version
{
"url": "http://validationhell.com",
"messages": [{
"type": "info",
"message": "The Content-Type was “text/html”. Using the HTML parser."
}, {
"type": "info",
"message": "Using the schema for HTML5 + SVG 1.1 + MathML 3.0 + RDFa Lite 1.1."
}, {
"type": "error",
@jaimeiniesta
jaimeiniesta / cli_response.json
Created March 16, 2015 09:04
JSON CLI Vs Web response on validator.nu
{
"messages": [
{
"type": "info",
"url": "http://validationhell.com",
"lastLine": 1,
"lastColumn": 109,
"firstColumn": 1,
"subType": "warning",
"message": "Obsolete doctype. Expected “<!DOCTYPE html>”.",
@jaimeiniesta
jaimeiniesta / response.bash
Created March 23, 2015 01:44
Example of 400 Bad Request response from Tenon
➔ curl -i -X POST -H Content-Type:application/x-www-form-urlencoded -H Cache-Control:no-cache -d 'url=bad&key=my-api-key' http://tenon.io/api/
HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Mon, 23 Mar 2015 01:42:00 GMT
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.5.9-1ubuntu4.5
Set-Cookie: PHPSESSID=g119888uljiho5ihgmfsh70ga3; path=/
A small test to know if Rails 3 will double-escape already escaped strings, say, you've got your typical h(str), will str be escaped once by default and then escaped once again by h()? It does not look like this will happen (tried with rails 2.3.5 and the rails_xss plugin)
### .erb file
<% str = "A string that needs <strong>escaping</strong>" %>
<p>
Not escaped: <%= str %>
</p>
<p>
Escaped with h: <%= h str %>
feature "Articles", %q{
In order to manage articles
As an editor
I want to create, list, show, edit, update and destroy articles
} do
background do
Article.create(:title => 'First article', :body => 'My first article')
Article.create(:title => 'Second article', :body => 'My second article')
Article.create(:title => 'Third article', :body => 'My third article')
require "net/http"
module GooglePageRank
M=0x100000000 # modulo for unsigned int 32bit(4byte)
def m1(a,b,c,d)
return (((a+(M-b)+(M-c))%M)^(d%M))%M # mix/power mod
end