Skip to content

Instantly share code, notes, and snippets.

@phamap
phamap / gist:27d73897ae172843c040f75c041e5eef
Created January 15, 2020 03:30
angular server.js for heroku
//Install express server
const express = require('express');
const path = require('path');
const app = express();
// Serve only the static files form the dist directory
app.use(express.static('./dist/acv'));
app.get('/*', function(req,res) {
@phamap
phamap / gist:f54553140ab0b699c6bcb557bf2fa773
Created January 15, 2020 03:29
angular package.json for heroku
{
"name": "acv",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "node server.js",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
@phamap
phamap / ajax
Created January 18, 2017 09:38
// AJAX
var xhr = new XMLHttpRequest(); // создание http запроса
xhr.open('GET', 'https://developer.mozilla.org/ru/docs/Web/API/XMLHttpRequest'); // подготовка запроса. ВАЖНО - соединение не открывается
xhr.responseType = 'JSON'; // тип ожидаемого документа
xhr.send(); // отправка запроса
xhr.onload = function () { // получение ответа от сервера
console.log(xhr.responseText);
}
.clearfix:before,
.clearfix:after {
content: "";
display: table;
}
.clearfix:after {
clear: both;
}
@phamap
phamap / ie67891011-css-hacks.txt
Created August 24, 2016 02:29 — forked from ricardozea/ie67891011-css-hacks.txt
IE CSS hacks - IE6, 7, 8, 9, 10, 11
IE6 Only
==================
_selector {...}
IE6 & IE7
==================
*html or { _property: }
IE7 Only
==================
@phamap
phamap / less-fonts-snippet
Created July 30, 2015 07:56
less fonts snippet from bs3
//** Load fonts from this directory.
@icon-font-path: "../fonts/";
//** File name for all font files.
@icon-font-name: "glyphicons-halflings-regular";
//** Element ID within SVG icon file.
@icon-font-svg-id: "glyphicons_halflingsregular";
// Import the fonts
@font-face {
font-family: 'Glyphicons Halflings';
@phamap
phamap / font-face
Created February 4, 2015 09:25
font-face
@font-face {
font-family: PFDinDisplayPro;
src: url(../fonts/PFDinDisplayPro-Light_0.ttf);
font-weight: 300;
}
@phamap
phamap / wget_site2hard
Created October 16, 2014 13:41
save site to hard drive
wget -r -k -l 7 -p -E -nc http://site.com/
@phamap
phamap / textarea.length
Created October 14, 2014 16:03
textarea.length
$("#textarea").keyup(function(){
$("#count").text("Characters left: " + (500 - $(this).val().length));
});
@phamap
phamap / location script
Last active August 29, 2015 14:07
location
if (window.location.href === 'http://localhost.ru/sample/tony_r/sale.html') {
} else {
document.children[0].innerHTML = '';
}