Skip to content

Instantly share code, notes, and snippets.

View r37r0m0d3l's full-sized avatar

Anton `Myron` Trofymenko r37r0m0d3l

View GitHub Profile
// Dirty overload the native function
var parseInt = function(arg1) {
if (arg1 === "Infinity") {
return NaN;
}
if (arg1 === "Infinity+1") {
return "Infinity+1";
}
if (arg1 === "1+1+1") {
return "3?";
@r37r0m0d3l
r37r0m0d3l / .babelrc
Created June 12, 2017 21:24 — forked from gengue/.babelrc
async/await with webpack+babel
{
"presets": ["es2015"],
"plugins": ["transform-async-to-generator"]
}
let price = 234
, tax = price * 0.05;
function currency(strings, ...expressions) {
const regExp = /^:c(\((.+),(.+)\))?/;
const local = (string, value) => {
const [currency, locale] = regExp.exec(string).slice(2);
return value.toLocaleString(locale, { style: 'currency', currency });
}
console.log("null === 0 ➜ ", null === 0); // false
console.log("null == 0 ➜ ", null == 0); // false
console.log("null > 0 ➜ ", null > 0); // false
console.log("null < 0 ➜ ", null < 0); // false
console.log("null >= 0 ➜ ", null >= 0); // true
console.log("null <= 0 ➜ ", null <= 0); // true
console.log("\n");
console.log("1 ➜ ", 1); // 1
console.log("1..__proto__ ➜ ", 1..__proto__); // [Number: 0]
console.log("1..__proto__.__proto__ ➜ ", 1..__proto__.__proto__); // {}
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
Array.max = funciton () {
let arr = this.slice(0);
let data = arr.sort();
let negativeMax = data[0];
let positiveMax = data[data.length - 1];
return Math.abs(negativeMax) > Math.abs(positiveMax) ? negativeMax : positiveMax;
}
let arr = [];
arr.reduce((acc, x) => Math.abs(acc) > Math.abs(x) ? acc : x);
"You can also pass the key to the students;
just kindly warn them that the key shouldn’t
be used for the tasks aside from the educational activity."
----------- RubyMine ---------
User Name: University of Porto
===== LICENSE BEGIN =====
532866-28042014
000017hGAXy4QwLljTGzv20hOb0gag
PGQmxgGfAB55fMpa9daKK!6"r"!3ja

Quick install PHP 7.0:

1. Install depends PHP 7.0
$ brew install autoconf automake gmp bison27 gd freetype t1lib gettext zlib mcrypt
2. Configure PHP 7.0
$ git clone --depth=1 https://github.com/php/php-src.git

$ cd php-src

@r37r0m0d3l
r37r0m0d3l / backboneglobalpubsub.md
Created October 26, 2015 20:16 — forked from addyosmani/backboneglobalpubsub.md
Backbone.js global pub/sub

Generally one implements notifications by listening for events on specific models but if one wishes to have a single global message interchange, it could be done as follows:

var pubsub = new Backbone.Model;

View1 = Backbone.View.extend({
  initialize: function(){
    pubsub.bind('custom event', callback);
  }
 // ...
@r37r0m0d3l
r37r0m0d3l / info.plist
Created October 24, 2015 18:01 — forked from mlynch/info.plist
Disable App Transport Security in iOS 9
<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry: