Skip to content

Instantly share code, notes, and snippets.

View nachodd's full-sized avatar

Ignacio Durand nachodd

  • Expero
  • Rosario, Santa Fé, Argentina
View GitHub Profile
@umidjons
umidjons / pub-sub.php
Created January 13, 2014 09:15
PubSub pattern / Events in PHP
<?php
// more: http://baylorrae.com/php-pubsub/
class PubSub
{
private static $events = array(); // all subscriptions
// Don't allow PubSub to be initialized outside this class
@nachodd
nachodd / request.js
Created November 19, 2019 17:57
Axios instance creation, with request and response handling (managing auth header and error responses). (vue.js project)
/* eslint-disable no-unreachable */
/* eslint-disable require-atomic-updates */
// import _ from "lodash"; // LODASH is imported and used globally, configured in webpack
import axios from "axios"
import store from "store" // store is the Vuex store instance
import router from "router" // router is the Vue Router instance
import { warn, warnDialogParse } from "utils/alerts" // helpers to show alerts and error messages
// create an axios instance
@Akryum
Akryum / FileExplorer.vue
Last active November 25, 2019 18:29
Example of migration to Vue Function-based Component API
<script>
import { isValidMultiName } from '@/util/folders'
import FOLDER_CURRENT from '@/graphql/folder/folderCurrent.gql'
import FOLDERS_FAVORITE from '@/graphql/folder/foldersFavorite.gql'
import FOLDER_OPEN from '@/graphql/folder/folderOpen.gql'
import FOLDER_OPEN_PARENT from '@/graphql/folder/folderOpenParent.gql'
import FOLDER_SET_FAVORITE from '@/graphql/folder/folderSetFavorite.gql'
import PROJECT_CWD_RESET from '@/graphql/project/projectCwdReset.gql'
import FOLDER_CREATE from '@/graphql/folder/folderCreate.gql'
@xeptore
xeptore / fp.md
Last active April 21, 2020 22:54
my fp learning tips and quick recaps

FP Tips and Quick Recaps

Currying

const add = (x) => (y) => x + y;
const addTen = add(10);
const incerement = add(1)

console.log(addTen(4)); // 14
console.log(incremenet(5)); // 6
@justincarroll
justincarroll / bootstrap-masonry-template.htm
Last active August 15, 2020 16:48
This is my template for using Masonry 3 with Bootstrap 3. For those of you who follow this gist a lot has changed since Bootstrap 2.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">
@ElRodrigote
ElRodrigote / Colonia.md
Last active January 19, 2021 23:11
Guía util

Take into account

  • If you go there for a couple of days try to rent a room with AirBNB, is cheaper than hotels and you'll save a lot using the kitchen. Everything is really expensive in Colonia, so eating in a restaurant can be VERY expensive. I can recommend you a guy who is a developer and has an apartment for rent
  • Buy some Uruguayan pesos before going there to have pocket cash. Don't use Argentinean pesos because they will take advantage of you. Don't buy uruguayan pesos in Colonia, do it in Argentina before traveling
  • Don't withdraw Uruguayan pesos the ATM, do dollars and then if you need pesos you can sell dollars which will be much cheaper
  • Not every business will accept the Payoneer card, but those who do, you need to tell them is a prepaid or debit card. You'll be asked to enter your PIN
  • Ferries: Colonia Express is the cheapest, but their service is not as good as Buquebus. If you chose to do Buquebus buy your tickets in Seacat instead of doing it directly in BuqueBus
  • If you go for the day
@sasxa
sasxa / emitter.service.ts
Created January 2, 2016 05:27
Angular2 Communicating between sibling components
import {Injectable, EventEmitter} from 'angular2/core';
@Injectable()
export class EmitterService {
private static _emitters: { [ID: string]: EventEmitter<any> } = {};
static get(ID: string): EventEmitter<any> {
if (!this._emitters[ID])
this._emitters[ID] = new EventEmitter();
return this._emitters[ID];
let child = require("child_process")
let source_map = require("source-map")
let SourceMapConsumer = source_map.SourceMapConsumer
let path = require("path")
var crypto = require('crypto');
module.exports = function(source, sourceMap) {
this.cacheable()
this.async()
var self = this
@nightscape
nightscape / Example.java
Created October 21, 2016 19:59
Simple RxJava-based adapter for an Android RecyclerView
public class ReactiveTextViewHolder<T> extends ReactiveViewHolder<T> {
private TextView label;
private T currentItem;
public ReactiveTextViewHolder(View itemView) {
super(itemView);
label = (TextView) itemView.findViewById(android.R.id.text1);
}
@autumnwoodberry
autumnwoodberry / user.js
Last active March 24, 2022 06:49
vuex + vuelidate
import Vue from 'vue'
import { validationMixin } from 'vuelidate'
import { required, minLength } from 'vuelidate/lib/validators'
export default function (store) {
const validator = new Vue({
mixins: [
validationMixin
],
computed: {