Skip to content

Instantly share code, notes, and snippets.

🌑

Kamil Ogórek kamilogorek

🌑
Block or report user

Report or block kamilogorek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View git-workflow.md

GIT WORKFLOW OF OUR CHOICE - FORKS WITH FEATURE BRANCHES

Git is well-known and lately pretty popular version control system, which helps developers to take care of their codebases.

Unlike SVN, it's decentralised and it lets you work locally, without any internet access, what can save your precious time more often then you may actually think. On the other hand it beats Mercurial with it's massive number of functionalities, which may be sometimes overwhelming for some of the developers.

Git has conquered whole internet surprisingly fast, therefore we also decided to take an advantage of it in our current projects.

For a lot of developers teams, starting to work using brand new system rises a lot of questions, from among which, the most important one is how they should settle their workflow.

View gist:6586221
<code>$ mkdir [your-project]</code>
<code>$ cd [your-project]</code>
<code>$ git init</code>
<code>$ git remote add origin [repo-url]</code>
<code>$ touch README.md (to create README file)</code>
<code>$ git add README.md</code>
<code>$ git commit -m "Init commit"</code>
<code>$ git push origin master -u</code>
@kamilogorek
kamilogorek / diff.html
Created Oct 21, 2013
scoreunder/lodash 1.3.0 diff
View diff.html
<html>
<head>
<title>Scoreunder/LoDash Diff</title>
<style type="text/css">
body {
padding: 2em;
font: 18px Monaco;
}
.add {
background: rgba(0,255,0,0.1);
@kamilogorek
kamilogorek / lessphp-grunt-task.js
Created Nov 15, 2013
Task for building LESS files using LESSPHP
View lessphp-grunt-task.js
module.exports = function(grunt) {
'use strict';
var execSync = require('exec-sync');
grunt.initConfig({
lessphp: {
files: {
'path/to/source.less': 'path/to/compiled.css',
}
View thanksgivingScripting.js
(function makeThanksgivingHappen (wishes) {
function Thanks () {
this.given = false;
}
Thanks.prototype.give = function () {
this.given = true;
}
var thanks = new Thanks();
@kamilogorek
kamilogorek / livereload-snippet.html
Created Jan 12, 2014
Static node.js server with livereload
View livereload-snippet.html
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
@kamilogorek
kamilogorek / wait-for-images.js
Created Feb 5, 2014
Wait for all images to load before executing callback
View wait-for-images.js
'use strict';
module.exports = function (element, callback) {
var allImgsLength = 0;
var allImgsLoaded = 0;
var allImgs = [];
var filtered = Array.prototype.filter.call(element.querySelectorAll('img'), function (item) {
if (item.src === '') {
return false;
@kamilogorek
kamilogorek / hub-commits.sh
Last active Aug 29, 2015
Hub Workflow Snippets
View hub-commits.sh
$ git remote add <username> <fork-url>
$ git fetch <username>
$ git checkout <PR-branch-name>
@kamilogorek
kamilogorek / quicksort.js
Last active Aug 29, 2015
Quicksort on 1.000.000 random elements within 0 – 1.000.000 range
View quicksort.js
/**
* Quicksort implementation by Nicholas C. Zakas
* http://www.nczonline.net/blog/2012/11/27/computer-science-in-javascript-quicksort/
*/
var items = [];
for (var i = 0; i < 1000000; i++) {
items.push(Math.round(Math.random() * 1000000));
}
You can’t perform that action at this time.