Skip to content

Instantly share code, notes, and snippets.

View vvscode's full-sized avatar
⌨️
Here is Rhodes, jump here!

Vasiliy Vanchuk vvscode

⌨️
Here is Rhodes, jump here!
View GitHub Profile
@vvscode
vvscode / HTTP-Proxy for dev
Last active August 29, 2015 13:59
Lightweight server to run and test SPA bounded to API service
var express = require('express');
var app = express();
var httpProxy = require('http-proxy');
var dirname = __dirname;
var port = process.env.PORT || 8081;
var extservice = 'xxx.ru';
var extProtocol = 'http:';
var extPort = 9000;
@vvscode
vvscode / curl-functions.php
Created August 9, 2014 07:33
Curl: wrapper-functions
<?php
// инициализирует курл
// возвращает сессию курла
function curl_ini(){
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_COOKIEJAR,realpath(".").'/tmp/cookies.txt');
@vvscode
vvscode / configExamlple.js
Created April 23, 2015 10:35
Example for using components
// Example for using formConfig
var fields = [
{
"name":"payment_approved",
"type":"checkbox-field",
"label":"Payment Approved:"
},
{
"name":"associated_contact",
"type":"contact-select",
@vvscode
vvscode / waitElement.js
Last active August 29, 2015 14:22
waitElement in DOM
function waitElement(selector, callback, delay) {
delay = delay || 100;
setTimeout(function() {
if(jQuery(selector).length) {
callback();
} else {
waitElement(selector, callback, delay);
}
}, delay);
// Source http://www.thatjsdude.com/interview/js1.html
/*
|--------------------------------------------------------------------------
| Log p()
|--------------------------------------------------------------------------
|
*/
var p = function(a) {

##Офтоп

  • Почему решили покинуть предыдущее место работы?

##Теория

  • В чем разница между inline, block, inline-block?
  • Чем отличается margin от padding?
  • Что такое overflow, когда он нужен?
  • Чем отличаются position static, absolute, relative, fixed?
  • Что вы знаете о приоритете селекторов?
  • Как браузер обрабатывает селекторы? Какие из них более производительные?
@vvscode
vvscode / jsnext4apollo.md
Created October 15, 2015 21:23
es6 for apollo

Значение параметров по-умолчанию. Пока работает только статическое определение, те вы можете задать только явное значение по умолчанию. Динамическое ( когда значение второго параметра основывается на первом ) -- не работает

function testDefaultParams(test = 1, test2 = "2") {
	// ...
	console.log(test, test2);
}
// с деструктуризацией
function foo({x, y = 5}) {
	console.log(x, y);
@vvscode
vvscode / UpsJs.md
Last active November 13, 2015 13:04
UpsJS.md

*** Task #1 *** Создать функцию function sum() { /* ... */ }

var s = sum();
alert(s); // 0
alert(s(1)); // 1
alert(s(1)(2)); //3
alert(s(3)(4)(5)); // 12
@vvscode
vvscode / ember.js-videos.md
Created October 25, 2015 19:41 — forked from listochkin/ember.js-videos.md
Ember.js Video Collection
  1. Официальные видео:
  2. Toran Billups записал очень хорошие базовые видео:
  3. Архитектура:
@vvscode
vvscode / my-ng.js
Last active February 3, 2019 10:34
Smartjs-Angulart-T1
(function(window) {
var directives = {};
var pairRegExp = /^(.+?)=(.+?)$/;
var myNg = {
directive: function(name, fn) {
directives[name] = {
name: name,
fn: fn
};