Skip to content

Instantly share code, notes, and snippets.

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

Newton Miyoshi newtonsbm

🏠
Working from home
View GitHub Profile
@newtonsbm
newtonsbm / gist:5356457
Created April 10, 2013 17:00
CodeSchool - BackBone.js - Level 6 - Challenge 6
//A (Correct)
var AppointmentList = Backbone.Collection.extend({
model: Appointment,
initialize: function(){
this.on('remove',this.hideModel);
},
hideModel: function(model){
model.trigger('hide');
}
});
@newtonsbm
newtonsbm / 0_reuse_code.js
Created October 15, 2013 16:43
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@newtonsbm
newtonsbm / loop.sh
Created October 16, 2013 11:43
how to do loop in bash scripts
#!/bin/bash
# nested-loop.sh: Nested "for" loops.
outer=1 # Set outer loop counter.
# Beginning of outer loop.
for a in 1 2 3 4 5
do
echo "Pass $outer in outer loop."
echo "---------------------"
@newtonsbm
newtonsbm / xdebug_subl_vagrant
Last active August 29, 2015 14:04
Configuring Xdebug PHP + Sublime + Vagrant
inside: myproj.sublime-project:
{
"folders":
[
{
"follow_symlinks": true,
"path": "D:\\www\\myproj"
}
],
"settings": {
@newtonsbm
newtonsbm / BootstrapLiHelper.php
Created May 3, 2015 13:35
CakePHP Helper to build a bootstrap menu item with an font-awesome icon
<?php
App::uses('AppHelper', 'View/Helper');
class BootstrapHelper extends AppHelper {
public $helpers = array('Html');
/**
* navLi: adds a li item with a link
*
@newtonsbm
newtonsbm / sshkeygencopy.sh
Created August 21, 2015 14:45
ssh keygen copy
# ssh-keygen
then copy it on the server with one simple command:
# ssh-copy-id hostname
you can now log in without password:
# ssh hostname