Skip to content

Instantly share code, notes, and snippets.

View georgymh's full-sized avatar
🇩🇴

Georgy Marrero georgymh

🇩🇴
View GitHub Profile
@georgymh
georgymh / pr_etiquette.md
Created October 21, 2018 22:54 — forked from mikepea/pr_etiquette.md
Pull Request Etiquette

Pull Request Etiquette

Why do we use a Pull Request workflow?

PRs are a great way of sharing information, and can help us be aware of the changes that are occuring in our codebase. They are also an excellent way of getting peer review on the work that we do, without the cost of working in direct pairs.

Ultimately though, the primary reason we use PRs is to encourage quality in the commits that are made to our code repositories

Done well, the commits (and their attached messages) contained within tell a story to people examining the code at a later date. If we are not careful to ensure the quality of these commits, we silently lose this ability.

@georgymh
georgymh / store.js
Created January 19, 2016 02:19
Flux Basic Store File
"use strict";
var Dispatcher = require('../dispatcher/appDispatcher');
var ActionTypes = require('../constants/actionTypes');
var EventEmitter = require('events').EventEmitter;
var assign = require('object-assign');
var CHANGE_EVENT = 'change';
var Store = assign({}, EventEmitter.prototype, {
addChangeListener: function(callback) {
@georgymh
georgymh / README.md
Last active January 17, 2016 23:54
Basic Gulp Environment
  1. Run the command npm install to resolve all dependencies
  2. Create the directories: dist/ and src/
  3. Create src/main.js file, and write there all browserify scripts
  4. Run the gulp command
  5. Start writing code inside the src/ directory
@georgymh
georgymh / reverseString.cpp
Last active November 26, 2015 00:01
Reverses a string recursively and non-recursively.
#include <string>
#include <iostream>
using namespace std;
void reverseStr(string& str);
string recursiveReverseStr(string& str);
int main()
{
@georgymh
georgymh / application.coffee
Created September 26, 2015 23:46 — forked from caleywoods/application.coffee
Backbone JS / Fullcalendar
$ ->
Event = Backbone.Model.extend()
Events = Backbone.Collection.extend({
Model: Event,
url : 'events'
})
EventsView = Backbone.View.extend({
initialize: ->
@georgymh
georgymh / SocialMediaHandlerFromURL.php
Created August 6, 2015 06:40
Functions to get social media handlers from URL.
<?php
/*
Right now it only works with Facebook, Twitter, and Instagram.
Very very beta version. Treat softly :)
*/
function getFacebookHandlerFromURL($fbURL) {
$lowercaseURL = strtolower($fbURL);
@georgymh
georgymh / imageresizing.php
Last active December 6, 2024 18:39
PHP Image resizing and cropping methods.
<?php
/*
Creates a thumbnail keeping the aspect ratio of the source image, and
saves it to a destination $dest.
Credits: http://davidwalsh.name/create-image-thumbnail-php
*/
function make_thumb($src, $dest, $desired_width) {
$info = getimagesize($src);
@georgymh
georgymh / register.php
Last active August 29, 2015 14:25
Sending form data (and image file) through AJAX to PHP.
<?php
require __DIR__ . '/../vendor/autoload.php';
use Respect\Validation\Validator as v;
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// First, get the data from the POST request.
$firstName = $_POST["form-first-name"];
$lastName = $_POST["form-last-name"];
@georgymh
georgymh / Delegates.swift
Last active August 29, 2015 14:23
Protocol and Delegates Playground
//: Playground - noun: a place where people can play
import UIKit
import Foundation
@objc protocol Speaker {
func Speak()
optional func TellJoke()
}