git
discard all local changes/commits and pull from upstream
git reset --hard origin/master
git pull origin master
To ignore file:
git checkout pom.xml
To perform a pull:
<?php | |
/** | |
* The __halt_compiler() function will stop the PHP compiler when called. | |
* You can then use the __COMPILER_HALT_OFFSET__ constant to grab the contents of the PHP file after the halt. | |
* In this example a PHP template is stored after the halt, to allow simple separation of logic from templating. | |
* The template is stored in a temporary file so it can be included and parsed. | |
* | |
* See: https://github.com/bobthecow/mustache.php/blob/dev/src/Mustache/Loader/InlineLoader.php | |
* http://php.net/manual/en/function.halt-compiler.php | |
*/ |
/* | |
Cookies can only store strings. Therefore, you need to convert your array of objects into a JSON string. | |
If you have the JSON library, you can simply use JSON.stringify(people) and store that in the cookie, | |
then use $.parseJSON(people) to un-stringify it. | |
In the end, your code would look like: | |
*/ | |
var people = [ | |
{ 'name' : 'Abel', 'age' : 1 }, | |
{ 'name' : 'Bella', 'age' : 2 }, |
/** | |
* Modify the parts you need to get it working. | |
*/ | |
var should = require('should'); | |
var request = require('../node_modules/request'); | |
var io = require('socket.io-client'); | |
var serverUrl = 'http://localhost'; |
git
discard all local changes/commits and pull from upstream
git reset --hard origin/master
git pull origin master
To ignore file:
git checkout pom.xml
To perform a pull:
drop table ba_paper_keyword; | |
create table ba_paper_keyword as | |
( | |
select p.id, p.keyword, count(p.keyword) count | |
from | |
(select id | |
, trim (both ';,.:?()"' from regexp_split_to_table(lower(paper.keyword), E'\\\s+')) AS keyword | |
from paper)p | |
group by p.id, p.keyword | |
) |
if (window.innerWidth > 640) { | |
var floatParentNode = document.querySelector('.js-parent'); | |
var floatNode = document.querySelector('.js-float'); | |
var valScrollForFixed = floatParentNode.getBoundingClientRect().top + window.pageYOffset - document.querySelector('.js-header').offsetHeight; | |
window.addEventListener('scroll', function () { | |
if (window.innerHeight > floatNode.offsetHeight) { | |
var windowScrollTop = window.pageYOffset; | |
var footerTop = document.querySelector('.js-footer').getBoundingClientRect().top + windowScrollTop; | |
var footerHeight = document.querySelector('.js-footer').clientHeight; |
// http://learn.javascript.ru/external-script | |
function addScript(src){ | |
var script = document.createElement('script'); | |
script.src = src; | |
script.async = false; // чтобы гарантировать порядок | |
document.head.appendChild(script); | |
} | |
addScript('1.js'); // загружаться эти скрипты начнут сразу |
// http://frontender.info/essential-javascript-functions/ | |
// Возвращает функцию, которая не будет срабатывать, пока продолжает вызываться. | |
// Она сработает только один раз через N миллисекунд после последнего вызова. | |
// Если ей передан аргумент `immediate`, то она будет вызвана один раз сразу после | |
// первого запуска. | |
function debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { |
<?php | |
/** | |
* @file | |
* Basic demonstration of how to do parallel threads in PHP. | |
*/ | |
// This array of "tasks" could be anything. For demonstration purposes | |
// these are just strings, but they could be a callback, class or | |
// include file (hell, even code-as-a-string to pass to eval()). |
/** | |
* Stop propagation behavior for scroll of the element but body. | |
* Compatibility: IE9+ | |
* Ref: | |
* - http://stackoverflow.com/questions/5802467/prevent-scrolling-of-parent-element#answer-16324762 | |
* - https://developer.mozilla.org/en-US/docs/Web/Events/wheel | |
*/ | |
;(function ($) { | |
$.fn.scrollable = function () { | |
this.on('wheel', function (event) { |