Skip to content

Instantly share code, notes, and snippets.

View icemancast's full-sized avatar

Isaac Castillo icemancast

View GitHub Profile
@icemancast
icemancast / gist:7444673
Created November 13, 2013 06:32
land lord email
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<style></style>
</head>
<body style="background: #6e6e6e;">
// List all elements from routes promise
listIt: function () {
users = this.get('controllers.application.users');
return users
}.property('users'),
deleteUser: function (key) {
messageMethod.build('User', 'DELETE', '', key, function (data) {
console.log('deleted');
});
// News click switcher
$('li[id*="newsSwitch-"').click(function (evt) {
var speed = 100;
var clickedClass = evt.currentTarget.id;
var clickedNumber = clickedClass.match(/\d/);
var title = document.getElementById('newsSwitch-title-' + clickedNumber).innerHTML;
formError: function(errors)
{
var message = errorMessages(errors.exType);
return message;
},
<div class="message">
{{formError}}
</div>
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
export PATH="/usr/local/bin:/usr/local/bin/subl:~/bin:$PATH"
<?php
return array(
'debug' => true,
);
@icemancast
icemancast / PostsController.php
Last active August 5, 2016 13:20
Laravel return json from url
// Create an action for the route
public function postToJson()
{
// Query here for json you want to return
$post = Post::all();
// Send to json response
return Response::json($post->toArray(), 200);
}
<%= link_to 'Deposit', new_transaction_path(type: 'deposit') %>
# routes
get 'transactions/new/:type' => 'transactions#new'
resources :transactions
transactions GET /transactions(.:format) transactions#index
POST /transactions(.:format) transactions#create
new_transaction GET /transactions/new(.:format) transactions#new
edit_transaction GET /transactions/:id/edit(.:format) transactions#edit
@icemancast
icemancast / elaine.php
Last active August 29, 2015 14:05
Elaine Likes Me Alot
<?php
// Remember the class is aware.
// ==========================
function askElaine() {
echo 'Do you like me yes || no!' . PHP_EOL;
}
function doesLikeMe() {
echo 'I just want to be friends!' . PHP_EOL;

Getbootstrap.com

  1. pick template
  2. or bootswatch
  3. create a local template blog.html in codeup.dev
  4. get creative with look
  5. load moment.js file
  6. use moment.js to alter the date
  7. load your own javascript file for your js code
  8. post json should follow format: