This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GIT | |
remote: git://github.com/leshill/handlebars_assets.git | |
revision: 03cb3ed3f44b1e2f669432a8d6aa346a4b25b6d2 | |
specs: | |
handlebars_assets (0.22.0) | |
execjs (~> 2.0) | |
multi_json (~> 1.0) | |
sprockets (>= 2.0.0) | |
tilt (>= 1.2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def delete(line) | |
tmp = Tempfile.new("todo_temp") | |
open(file, "r").each.with_index do |index, l| | |
tmp << l unless line == index.to_i | |
end | |
tmp.close | |
FileUtils.mv(tmp.path, file) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onload = function () { | |
var width = 800, | |
height = 800, | |
platformWidth = 200, | |
sprite, | |
platforms, | |
game = new Phaser.Game(800, 700, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update }); | |
function preload() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#In my schema | |
t.string "picture", default: [], array: true | |
#In my projects_controller.rb | |
def index | |
@projects = Project.friendly.all | |
end | |
def show | |
@project = Project.friendly.find(params[:id]) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index(conn, _params) do | |
case authenticate(conn) do | |
%Plug.Conn{halted: true} = conn -> | |
conn | |
conn -> | |
users = Repo.all(User) | |
render conn, "index.html", users: users | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule NaturalNums do | |
def print(1), do: IO.puts(1) | |
def print(n) do | |
print(n - 1) | |
IO.puts(n) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Cvapp.Auth do | |
import Comeonin.Bcrypt, only: [checkpw: 2, dummy_checkpw: 0] | |
import Plug.Conn | |
def login(conn, user) do | |
conn | |
|> assign(:current_user, user) | |
|> Guardian.Plug.sign_in(user) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<title>Hello Cvapp!</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prefix Verb URI Pattern Controller#Action | |
new_user_session GET /users/sign_in(.:format) devise/sessions#new | |
user_session POST /users/sign_in(.:format) devise/sessions#create | |
destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy | |
user_password POST /users/password(.:format) devise/passwords#create | |
new_user_password GET /users/password/new(.:format) devise/passwords#new | |
edit_user_password GET /users/password/edit(.:format) devise/passwords#edit | |
PATCH /users/password(.:format) devise/passwords#update | |
PUT /users/password(.:format) devise/passwords#update | |
cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%{"batchcomplete" => "", | |
"query" => %{"normalized" => [%{"from" => "test", "to" => "Test"}], | |
"pages" => %{"11089416" => %{"extract" => "Test, TEST or Tester may refer to:\nTest (assessment), an assessment intended to measure the respondents' knowledge or other abilities\nMedical test, to detect, diagnose, or monitor diseases", | |
"ns" => 0, "pageid" => 11089416, "title" => "Test"}}}} |
OlderNewer