Skip to content
View readability.rb
#!/usr/bin/env ruby
# Author : Emad Elsaid (https://github.com/blazeeboy)
# **Usage** :
#
# * `ruby readability.rb <accesstoken>`
# this will get a long term access token from the short term one
# you can create a facebook app and get access token from here
# * `ruby readability.rb`
# will start the script
require 'open-uri'
View gist:8a80863b6d07655880eb
directivesModule.directive('test', function(){
return {
// restrict: 'AEC',
templateUrl: '/public/partials/test.html',
scope:{
write: function(){
console.log("working")
}
},
controller: function($scope){
View index.html
<script type="text/javascript" src="/public/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/public/lib/angular/angular.js"></script>
<script type="text/javascript" src="/public/lib/angular/angular-route.js"></script>
<script type="text/javascript" src="/public/lib/angular/angular-resource.min.js"></script>
<script type="text/javascript" src="/public/lib/angular/angular-cookies.min.js"></script>
<script type="text/javascript" src="/public/js/app.js"></script>
<script type="text/javascript" src="/public/js/services.js"></script>
<script type="text/javascript" src="/public/js/controllers.js"></script>
<script type="text/javascript" src="/public/js/controllers/signup.js"></script>
<script type="text/javascript" src="/public/js/controllers/login.js"></script>
View pqarray
type User struct {
Id int64
Name string
Email string
Username string
TablesIds []uint8
HashedPassword []byte
Created int64
Updated int64
}
View ex14.c
#include <stdio.h>
#include <ctype.h>
// forward declarations
int can_print_it(char ch);
void print_letters(char arg[]);
void print_arguments(int argc, char *argv[])
{
int i = 0;
View gsub.rb
@article_subbed = @article.body.gsub 'startcode', '<pre class="prettyprint">'
@article.body = @article_subbed.gsub 'endcode', '</pre>'
View signup.html.erb
<h2>Sign up</h2>
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :email, :required => true, :autofocus => true %>
<%= f.input :name %>
<%= f.input :password, :required => true %>
<%= f.input :password_confirmation, :required => true %>
View rails_auth.rb
def authenticate_with_email_and_password
passenger = Passenger.find_by_email(params[:email])
if passenger
if passenger.valid_password?(params[:password])
if passenger.confirmed?
passenger
else
render :json => {:result => "failure",:error => "not confirmed"}.to_json
return
end
View gist:5103326

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
Something went wrong with that request. Please try again.