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
javascript:alert("nb de jours: " + _.reduce($(".js-issue:not(.ghx-filtered) span.aui-badge").map(function(ind, item) { | |
console.log(item.innerText); | |
var res = item.innerText.match(/(\d+)?w/i); | |
var nbWeeks = res? 144000*parseInt(res[1]) : 0; | |
res = item.innerText.match(/(\d+)?d/i); | |
var nbDays = res? 28800*parseInt(res[1]) : 0; | |
res = item.innerText.match(/(\d+)?h/i); | |
var nbHours = res? 3600*parseInt(res[1]) : 0; | |
res = item.innerText.match(/(\d+)?m/i); | |
var nbMins = res? 60*parseInt(res[1]) : 0; |
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
var s = document.createElement('script'); | |
s.src = '//cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.3/moment.min.js'; | |
document.body.appendChild(s); | |
s.onload = function() { | |
var testDate = window.prompt('Date à comparer:', 'aaaa-mm-dd'); | |
var result = 'Il y a '+ ~~(moment.duration(moment(testDate).diff()).as('days')) + ' jours entre maintenant et '+ testDate; | |
window.alert(result); | |
}; |
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
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
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
library(testthat) | |
assert.best <- function () { | |
message("# Starting to test best(..)") | |
expect_equal(expected = "CYPRESS FAIRBANKS MEDICAL CENTER", object = best("TX", "heart attack")) | |
expect_equal(expected = "FORT DUNCAN MEDICAL CENTER", object = best("TX", "heart failure")) | |
expect_equal(expected = "JOHNS HOPKINS HOSPITAL, THE", object = best("MD", "heart attack")) |
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
curl http://169.254.169.254/latest/meta-data/instance-id |
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
/** | |
* @return Boolean | |
*/ | |
function fileUploadIsSupported() { | |
'use strict'; | |
// Look for mobile iOS 4 or 5 | |
return !(/(iPhone|iPad|iPod)(;)?(\s\w;)?(\s)?(CPU)?(\s)?(\sOS\s)(3|4|5)/.test(navigator.userAgent)); | |
} |
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
package | |
{ | |
import flash.data.SQLConnection; | |
import flash.data.SQLResult; | |
import flash.data.SQLStatement; | |
import flash.events.SQLErrorEvent; | |
import flash.filesystem.File; | |
public class ExpressionEvaluator | |
{ |
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
package com.yourdomain.utils.loader | |
{ | |
import flash.display.Loader; | |
import flash.filesystem.File; | |
import flash.net.URLRequest; | |
import flash.system.ApplicationDomain; | |
import flash.system.LoaderContext; | |
import flash.utils.getTimer; | |
/** |
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/env python | |
import requests | |
import argparse | |
parser = argparse.ArgumentParser(description='Generate a Github OAuth token.') | |
parser.add_argument('--user', metavar='u', dest='user', required=True, help='Github username') | |
parser.add_argument('--password', dest='password', required=True, help='Github password') | |
parser.add_argument('--2fa', dest='mfaToken', required=True, help='Github 2FA code') | |
args = parser.parse_args() |
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
limit_req_zone $request_uri zone=by_uri:10m rate=30r/m; | |
server { | |
listen 80; | |
location /by-uri/burst0 { | |
limit_req zone=by_uri; | |
try_files $uri /index.html; | |
} |
OlderNewer