Skip to content

Instantly share code, notes, and snippets.

View RinatMullayanov's full-sized avatar

Rinat Mullayanov RinatMullayanov

View GitHub Profile
<html>
<head>
<title></title>
</head>
<body>
Hi
<script>
var link = document.createElement('link')
link.setAttribute('rel', 'stylesheet')
link.setAttribute('href', require('path').join(__dirname, 'css', 'app.css'))
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@RinatMullayanov
RinatMullayanov / 1_ruby_quicksort.rb
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
# Use Gists to store entire functions
class QuickSort
def self.sort!(keys)
quick(keys,0,keys.size-1)
end
private
def self.quick(keys, left, right)
@RinatMullayanov
RinatMullayanov / gulpfile.js
Last active August 29, 2015 14:07
Sample gulpfile.js with using express
var gulp = require('gulp'),
compass = require('gulp-compass'),
express = require('express'),
gutil = require('gulp-util'),
path = require('path'),
refresh = require('gulp-livereload'),
server = require('tiny-lr')();
gulp.task('expressServer', function(){
app = express();