Skip to content

Instantly share code, notes, and snippets.

View neomadara's full-sized avatar
🏠
Working from home

Cristian Gutiérrez neomadara

🏠
Working from home
View GitHub Profile
@neomadara
neomadara / gist:ee4533fd4335711d0ea289b84017a6af
Last active July 13, 2021 23:42
Guillotine cutting algorithm
$paginador = 6;
$contador_interno = 1;
$total_tickets = 18;
$cada = ceil($total_tickets/$paginador);
$total_pagina = $cada * 5;
for($contador = 1; $contador<=$cada; $contador++){
for($contador_interno = $contador; $contador_interno<=$total_pagina+$contador; $contador_interno += $cada){
if($contador_interno<=$total_tickets){
echo $contador_interno.' ';
@neomadara
neomadara / app.js
Created December 28, 2016 02:48 — forked from jdnichollsc/app.js
Ionic Google OAuth Authentication, Firebase 3 and ngCordovaOauth plugin
angular.module('App', ['ionic', 'ngCordova', 'ngAnimate', 'ngCordovaOauth', 'firebase'])
.run(['$ionicPlatform',
'$rootScope',
'$firebaseAuth',
function($ionicPlatform, $rootScope, $firebaseAuth) {
$ionicPlatform.ready(function() {
if(window.cordova && window.cordova.plugins.Keyboard) {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
@nrollr
nrollr / MongoDB_macOS_Sierra.md
Last active April 1, 2024 16:23
Install MongoDB on Sierra using Homebrew

Install MongoDB on macOS Sierra

This procedure explains how to install MongoDB using Homebrew on macOS Sierra 10.12.
Official MongoDB install documentation: here

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Download and Install Vagrant http://www.vagrantup.com/ and VirtualBox https://www.virtualbox.org/ or VMware before beginning

#Set up Vagrant *this guide assumes the use of Mac OS X Mountain Lion on local machine and Ubuntu 12.04 LTS x64 on Vagrant box. It is compatible with many other distros but hasn't been tested.

##Step 1: Make and run box

vagrant init
vagrant box add <path to box directory or name according to https://vagrantcloud.com/>
vagrant up
@donnierayjones
donnierayjones / LICENSE
Last active June 24, 2024 14:28
Render Bootstrap as "small" layout when printing
Copyright (C) 2016 Donnie Ray Jones
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@alejandro
alejandro / continuable.js
Created December 3, 2012 02:52
JS: Estilo Continuable (Control Flow)
"use strict";
var Continuable = {}
Continuable.make = function make(fn) {
if ('function' !== typeof(fn)) throw new Error(fn + 'is not a function')
var evnt;
function first() {
var args = [].slice.call(arguments)
@zanshin
zanshin / .zshrc
Created August 12, 2011 19:09
My .zshrc file
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#export ZSH_THEME="robbyrussell"
export ZSH_THEME="zanshin"