Skip to content

Instantly share code, notes, and snippets.

View r37r0m0d3l's full-sized avatar

Anton Trofymenko r37r0m0d3l

View GitHub Profile
@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);
  }
 // ...

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

"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
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
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 });
}
@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"]
}
// 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?";
" Make IE Better Compatible "
<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
======================================================
IE6 Only
==================
_selector {...}
@r37r0m0d3l
r37r0m0d3l / install consolas on os x with one command
Created March 6, 2019 18:43 — forked from piperswe/ install consolas on os x with one command
Install Consolas on OS X (based on avalonalex/8125197)
Thanks to this Gist: https://gist.github.com/avalonalex/8125197
How to use: Make sure Homebrew is installed then run `curl https://gist.githubusercontent.com/zebMcCorkle/fa4508e27f457d7b796ffd474be35d62/raw/59942466b13fe92d09b4b537cc7fcfb309c05c4a/consolas.sh | bash -`
@r37r0m0d3l
r37r0m0d3l / download_egghead_videos.md
Created March 30, 2019 23:08 — forked from ldong/download_egghead_videos.md
download egghead videos

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App

run

$.each($('h4 a'), function(index, video){
  console.log(video.href);
});