Skip to content

Instantly share code, notes, and snippets.

View snit-ram's full-sized avatar

Rafael Martins snit-ram

View GitHub Profile
@snit-ram
snit-ram / todo.fish
Created April 9, 2014 21:18
function for searching for common TODO patterns using ag
function todo
ag $argv "TODO|FIXME|NOTE|CHANGED|@todo"
end
@snit-ram
snit-ram / grunt.fish
Last active August 29, 2015 14:06
Fish grunt completion
# Completion for grunt
# Modified version by snit
# place this file at ~/.config/fish/completions/grunt.fish
# grunt-cli
# http://gruntjs.com/
#
# Copyright (c) 2012 Tyler Kellen, contributors
# Licensed under the MIT license.
# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT
@snit-ram
snit-ram / hipchat-giphy
Last active September 13, 2018 18:02
hipchat-giphy "integration"
(function () {
function giphy(word, callback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.giphy.com/v1/gifs/translate?api_key=dc6zaTOxFJmzC&s=' + encodeURIComponent(word));
xhr.onreadystatechange = function(e) {
if(xhr.readyState === 4) {
var url = JSON.parse(e.target.responseText).data.images.fixed_height.url;
callback(url);
}
};
@snit-ram
snit-ram / bla.js
Last active September 29, 2016 13:59
var fetch = require('node-fetch');
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'me',
password : 'secret',
database : 'my_db'
});
connection.connect();
@snit-ram
snit-ram / collectionview.swift
Created February 10, 2016 01:09
collectionview.swift
//
// ViewController.swift
// sss
//
// Created by Rafael Martins on 2/9/16.
// Copyright © 2016 Yahoo Inc. All rights reserved.
//
import UIKit
function possibilities(numbers, remaining, expression) {
if (remaining < 0) {
return 0;
} else if (remaining === 0) {
console.log(expression.join(' + '));
return 1;
}
var result = 0;