Skip to content

Instantly share code, notes, and snippets.

View edwin-bluekite's full-sized avatar

Edwin Allen edwin-bluekite

  • Bluekite
  • Guatemala
View GitHub Profile
(load-theme 'wombat t)
(add-to-list 'load-path "~/.emacs.d")
(require 'php-mode)
;; To use abbrev-mode, add lines like this:
(add-to-list 'auto-mode-alist '("\\.php$" . php-mode))
(add-hook 'php-mode-hook 'my-php-mode-stuff)
(defun my-php-mode-stuff ()
@edwin-bluekite
edwin-bluekite / semicolon.el
Created February 1, 2013 13:57
Emacs Add semicolon at the end of the line
(defun semicolon ()
"Add semicolon at the end of the line and return to current position"
(interactive)
(setq current (point))
(end-of-line)
(if (not (= (preceding-char) 59))
(insert ";")
)
(goto-char current)
)
@edwin-bluekite
edwin-bluekite / window-backward.el
Last active December 20, 2015 17:38
emacs other-window-backward function
(defun other-window-backward(&optional n)
"Select Nth previows window"
(interactive "p")
(other-window (- (or n -1))
)
(global-set-key "\C-x\C-p" 'other-window-backward)
(global-set-key "\C-x\C-n" 'other-window)
@edwin-bluekite
edwin-bluekite / BlueAPIGuide.md
Created October 28, 2013 18:01
Bluekite REST API Design Guidlines (Draft)
App = Ember.Application.create()
App.Router.map ->
@route "entries", path: "/"
App.EntriesView = Ember.View.extend
templateName: 'entries'
App.NewEntryView = Ember.View.extend
templateName: 'new_entry'
@edwin-bluekite
edwin-bluekite / validation.js
Created February 18, 2014 18:07
Hapi Joi field validation
//Route
{
method: 'GET',
path: '/{version}/services/{path*}',
config:{
handler: {
proxy: {
mapUri: controller.payments.mapper ,
passThrough: true,
@edwin-bluekite
edwin-bluekite / storepagination.coffee
Last active August 29, 2015 13:59
Pagination Over EmberJS Store
Ember.FEATURES['ember-routing-drop-deprecated-action-style'] = true
App = Ember.Application.create({})
App.IndexController = Ember.ArrayController.extend(
page: 5
perPage: 10
start: (->
page = @get("page")
perPage = @get("perPage")
(page - 1) * perPage
).property("page", "perPage")
@edwin-bluekite
edwin-bluekite / sse.js
Last active August 29, 2015 14:01
Nipple post and get
// 1. I'm doing a post request to a resource
// 2. I read SSE url for the creation procces of the resource is readed in the link header of the response
// 3. I run a GET to that url an try to stream the SSE to stdout
var parse = require('parse-link-header');
var Nipple = require('nipple');
Nipple.post('resourceurl.com/myresource',{payload:somedata}, function (err1, res1, payload1) {
Nipple.read(res1, function (err1, body) {
$ sudo /usr/bin/sqlite3 /opt/nagios/var/rw/nagios_hosts.db 'create table add_hosts (hostname TEXT, dstamp INTEGER); create table del_hosts (hostname TEXT);'
$ sudo /opt/xoom/nagios/bin/process_api_hosts_icinga.sh add
$ vim /opt/nagios/etc/check_mk/conf.d/hosts.mk #check if is correct
$ sudo service monitoring start

Open viles

Browsing a directory

  • :e {route}

Navigation

  • $ principio de linea
  • 0 final de linia
  • w start of the next word
  • e end of the word
  • b beginig of word