Skip to content

Instantly share code, notes, and snippets.

var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}
@bobuk
bobuk / interstellar.md
Last active April 3, 2022 10:01
Interstellar review

Интерстеллар: Наука за кадром

Ребята из "Манн, Иванов и Фербер" дали мне почитать перевод книги Кипа Торна "The Science of Interstellar". Читать ее на английском мне было откровенно слабО, но перевод не подкачал.

Вообще, стоит сказать - книга не только (и не столько) о фильме, но и, на самом деле, об устройстве мира. Часто встречающиеся в фантастических рассказах или популярных статьях понятия объяснены для тупиц вроде меня, доступным языком. При этом автору удалось удержаться от примитивных ничего не объясняющих фраз, что, согласитесь, здорово.

Книга читается достаточно легко еще и за счет того, что научные объяснения в ней лежат не в виде тупо фактов - тут, знаете ли, есть сюжет. Вся книга это история создания фильма и общения между его создателями. Я не большой фанат картины, на мой взгляд это была не самая крутая работа Ноллана, но читать о том, как строится сюжет было очень интересно. С удивлением узнал что Ноллан умеет не только _

$vr-font-size: 15px !global;
$vr-line-height: 1.5 !global;
$vr-cap-height: 0.6 !global;
$vr-line-scale: 2 !global;
$vr-grid-unit: $vr-line-height * $vr-font-size / $vr-line-scale !global; // (px)
@function em($px: 0, $font-size: $vr-font-size) {
@return $px / $font-size + em;
}
HTMLTextAreaElement.prototype.getCaretPosition = function () { //return the caret position of the textarea
return this.selectionStart;
};
HTMLTextAreaElement.prototype.setCaretPosition = function (position) { //change the caret position of the textarea
this.selectionStart = position;
this.selectionEnd = position;
this.focus();
};
HTMLTextAreaElement.prototype.hasSelection = function () { //if the textarea has selection then return true
if (this.selectionStart == this.selectionEnd) {
@dshster
dshster / modslasses.js
Last active August 29, 2015 14:02
bem classes modifiers
(function() {
'use strict';
var delimiter = '--';
DOMTokenList.prototype.modify = function(mod) {
if (false === tag.classList.modified(mod)) {
this.add([this[0], delimiter, mod].join(''));
}
};
@pepelsbey
pepelsbey / hocus.scss
Last active March 1, 2024 11:03
Simple “Hocus” Sass @mixin for :hover and :focus pseudos. Makes them easier to write and you’ll never forget to specify both.
@mixin hocus {
&:hover,
&:focus {
@content;
}
}
// Before
E {
&:hover,
@bennadel
bennadel / http-angularjs.htm
Created April 21, 2014 16:52
Using The $http Service In AngularJS To Make AJAX Requests
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Using The $http Service In AngularJS To Make AJAX Requests
</title>
<style type="text/css">
@rtt
rtt / tinder-api-documentation.md
Last active April 20, 2024 17:01
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

@pasupulaphani
pasupulaphani / after_res_hooks.js
Last active May 1, 2024 20:37
Mongoose connection best practices
var db = mongoose.connect('mongodb://localhost:27017/DB');
// In middleware
app.use(function (req, res, next) {
// action after response
var afterResponse = function() {
logger.info({req: req}, "End request");
// any other clean ups
@robertkowalski
robertkowalski / npm-registry-licenses.txt
Created November 23, 2013 22:31
The licenses in the npm-registry from their package.json, from the latest version of each module 23.11.2013
The licenses in the npm-registry from their package.json, from the latest version of each module
23.11.2013
[ { key: 'undefined', value: 27785 },
{ key: 'MIT', value: 20811 },
{ key: 'BSD', value: 5240 },
{ key: 'BSD-2-Clause', value: 621 },
{ key: 'Apache 2.0', value: 263 },
{ key: 'GPL', value: 233 },