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
.col-lg-12 | |
- if @post.errors.any? | |
.alert.alert-danger | |
%ul | |
- @post.errors.full_messages.each do |message| | |
%li= message |
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
require "fileutils" | |
ICONS_DIR = "path-to-icons-dir" # Ex. "/home/nitish/Downloads/material-design-icons-1.0.0/" | |
PROJECT_RES_DIR = "path-to-res-dir-of-android-app" # Ex. "/home/nitish/Projects/android_app/app/src/main/res/" | |
DRAWABLES = ["drawable-hdpi", "drawable-mdpi", "drawable-xhdpi", "drawable-xxhdpi"] | |
COLORS = { | |
"grey" => "grey600", | |
"gray" => "grey600", | |
"black" => "black", | |
"white" => "white" |
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
CREATE TABLE employee( | |
id serial PRIMARY KEY NOT NULL, | |
given_name varchar(255), | |
surname varchar(255), | |
address text, | |
city varchar(255), | |
state varchar(255), | |
postal_code varchar(255), | |
role_id int, | |
hire_date date, |
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
gofmt -w $(find . -type f -name '*.go' -not -path "./vendor/*") |
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
# https://stackoverflow.com/a/43522719 + couple of fixes | |
def number_to_words(num) | |
numbers_to_name = { | |
10_000_000 => "crore", | |
100_000 => "lakh", | |
1000 => "thousand", | |
100 => "hundred", | |
90 => "ninety", | |
80 => "eighty", |
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
[ | |
{ | |
"key": "ctrl+t", | |
"command": "go.test.cursor", | |
"when": "editorLangId == go" | |
}, | |
{ | |
"key": "ctrl+t", | |
"command": "extension.runSpecLine", | |
"when": "editorLangId == ruby" |
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
require 'digest' | |
require 'json' | |
class Chain | |
def initialize | |
@blockchain = [] | |
@pending = [] | |
end | |
def add_block(proof) |