This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Documentation: https://support.comodo.com/index.php?/Default/Knowledgebase/Article/View/620/1/which-is-root-which-is-intermediate | |
Certification chain: | |
-UserTrust / AddTrust External Root | |
-COMODO RSA Certification Authority | |
-COMODO RSA Domain Validation Secure Server CA | |
-End-Entity/Domain Certificate | |
Bundle is created by certificates in reversing order (Domain Certificate first!). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sendRequest(method, targetURL, content, callback) { | |
var http = new XMLHttpRequest(), | |
message = (content !== undefined) ? JSON.stringify(content) : undefined; | |
http.open(method, targetURL, true); | |
if (message !== undefined) { /* GET requests may not have JSON content */ | |
http.setRequestHeader('Content-type', 'application/json; charset=utf-8'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* http://stackoverflow.com/questions/22211755/function-f-if-this-instanceof-f-return-new-f, | |
If constructor is called without 'new' keyword before, it returns a new instance of the object. */ | |
function MyObject(foo){ | |
if (!(this instanceof MyObject)){ | |
return new MyObject(foo); | |
} | |
this.bar = foo; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Idea from http://stackoverflow.com/a/14205994/4296439 */ | |
$input-background-color: white; | |
input:-webkit-autofill { | |
-webkit-box-shadow: 0 0 0 1000px $input-background-color inset; | |
box-shadow: 0 0 0 1000px $input-background-color inset; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SCP (Secure Copy, over SSH) | |
# Local to server | |
scp /path/to/retrieve user@domain.com:/path/to/save | |
# Server to local | |
scp user@domain.com:/path/to/retrieve /path/to/save | |
# Server to server | |
scp user@domain.com:/path/to/retrieve user2@domain2.com:/path/to/save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import requests | |
import urllib2 | |
# Current cookies (use 'document.cookie' in Console to get them) | |
cookies = '' | |
# Create a dict from that given ookies | |
cookies = dict(item.split("=", 1) for item in cookies.split("; ")) | |
# Files to be downloaded (paste them manually, use 'Copy link address'). Be careful to add ',' at the end of each line unless last |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* It returns only the first match || null */ | |
var $ = document.querySelector.bind(document); | |
/* Ex: $('a.link') */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Run: $ casperjs example.js */ | |
var casper = require('casper').create({ | |
verbose: true, /* Production mode: false */ | |
logLevel: 'debug', | |
pageSettings: { | |
loadImages: false, | |
loadPlugins: false | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replaceCommasDots() { | |
var id = ''; /* Your spreadsheet id (value after /id/*): https://docs.google.com/spreadsheets/d/:id/edit */ | |
var sheet = SpreadsheetApp.openById(id); | |
var range = sheet.getRange("A1:B2"); /* range you want to modify */ | |
var data = range.getValues(); | |
for (var row = 0; row < data.length; row++) { | |
for (var col = 0; col < data[row].length; col++) { | |
data[row][col] = (data[row][col]).toString().replace(/,/g, '.'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Based on: http://stackoverflow.com/a/8381494 */ | |
/* Date proptotype extension */ | |
Date.prototype.getWeek = function() { | |
/* I get the current date and then shift it */ | |
var today = new Date(this.setHours(0, 0, 0, 0)); /* Current date */ | |
var dayOfWeek = today.getDay() - 1; /* It starts on Monday (Sunday by default) */ | |
var dayOfMonth = today.getDate() - dayOfWeek; /* ([1-31]) Beginning of the week */ | |
/* Get range */ | |
var start = new Date(today.setDate(dayOfMonth)); /* Monday */ |