Skip to content

Instantly share code, notes, and snippets.

View carlqt's full-sized avatar
:octocat:
Hit me up

Carl Tablante carlqt

:octocat:
Hit me up
View GitHub Profile
@carlqt
carlqt / view
Created February 8, 2014 06:47
Additional info for SO
<ul id="cbp-bislideshow" class="cbp-bislideshow">
<li>
<%= image_tag "blur1.jpg" %>
</li>
<li>
<%= image_tag "blur2.jpg" %>
</li>
</ul>
<% provide(:title, 'Sign Up') %>
@carlqt
carlqt / gist:10346052
Created April 10, 2014 05:52
Log when sending an email
Sent mail to [email protected] (1151.0ms)
Return-Path: <[email protected]>
Date: Thu, 10 Apr 2014 13:51:21 +0800
From: "ServiceSeeking.com.au" <[email protected]>
Reply-To: [email protected]
To: [email protected]
Message-ID: <5346315914168_4634ffe845827a@carl-HP-Pavilion-15-Notebook-PC.mail>
Subject: New Negative Feedback
Mime-Version: 1.0
Content-Type: text/plain;
$(document).ready(function(){
$.ajax({
type: 'GET',
dataType: 'json',
url: 'http://localhost:3000/projects.json',
success: function(data, status, xhr) {
$.each(data, function(key, val){
console.log(data);
@carlqt
carlqt / gist:c22769df9c441994813e
Created August 9, 2014 00:32
Ruby global scoping
class Animal
def dog
"I'm a dog"
end
def cat
"I'm a cat"
end
def bird
@carlqt
carlqt / gist:12da03de616ce6ef2a36
Created December 6, 2014 00:50
Simple example of yml to xml
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
@carlqt
carlqt / demo_yaml
Created December 7, 2014 08:27
Sample YAML file
machine:
ruby:
version: 2.0.0-p247
test:
override:
# - bundle exec rspec --format documentation --color --pattern "**/*_spec.rb, ../engines/**/spec/**/*_spec.rb"
- bundle exec rspec --format documentation --color:
parallel: true
files:
- spec/**/*_spec.rb
@carlqt
carlqt / golden_age.rb
Created February 6, 2015 02:59
Golden Age problem
def golden_age array
start = 0
end_index = 0
max_sum = 0
largest = 0
sub_arr = array.dup
return_array = []
array.each_with_index do |num, ind|
start = ind
@carlqt
carlqt / rbenv.yml
Created November 18, 2015 08:49
Rbenv ansible playbook
---
- name: clone rbenv
git: repo=https://github.com/sstephenson/rbenv.git dest=/home/vagrant/.rbenv
- name: change ownership of .rbenv to vagrant
file: path=.rbenv owner=vagrant recurse=yes
- name: Add rbenv bin to profile
lineinfile: dest=/home/vagrant/.zshrc state=present regexp='^\.rbenv\/bin' line='export PATH=$PATH:/home/vagrant/.rbenv/bin'
@carlqt
carlqt / demo.js
Created July 25, 2016 09:58
Sample angularjs code
newApp.controller('newAppController', function newAppController($scope, $http) {
$scope.locations = {}
$http.get("/api/properties").success(function(data) {
$scope.locations = data;
});
$scope.searchNearby = function($event){
var keyCode = $event.which || $event.keyCode;
if (keyCode === 13) {
@carlqt
carlqt / main.go
Created September 24, 2016 08:57
main file
package main
import (
"fmt"
"github.com/carlqt/geodude/controllers/properties"
"github.com/carlqt/geodude/controllers/user"
"github.com/carlqt/geodude/geocode"
"github.com/carlqt/geodude/models"
"github.com/dgrijalva/jwt-go"