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:
| /** | |
| * 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) { |
| <?php | |
| $seed = str_split('abcdefghijklmnopqrstuvwxyz' | |
| .'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
| .'0123456789!@#$%^&*()'); // and any other characters | |
| shuffle($seed); // probably optional since array_is randomized; this may be redundant | |
| $rand = ''; | |
| foreach (array_rand($seed, 5) as $k) $rand .= $seed[$k]; | |
| echo $rand; |
| <?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()). |
| // 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() { |
| // 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'); // загружаться эти скрипты начнут сразу |
| 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; |
| 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 | |
| ) |
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:
| /** | |
| * 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'; |
| /* | |
| 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 }, |