Skip to content

Instantly share code, notes, and snippets.

View shtakai's full-sized avatar
🐤
I am leaning Ada.

Alyson shtakai

🐤
I am leaning Ada.
View GitHub Profile
@shtakai
shtakai / vimrc
Created May 30, 2016 04:02 — forked from mayuroks/vimrc
vimrc
set t_Co=256
set pastetoggle=<F8>
colorscheme wombat256mod
set hlsearch
set tabstop=4
set softtabstop=4
set shiftwidth=4
let g:indent_guides_auto_colors=0
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=3
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=4
var words = ["fun", "exciting", "about not giving up", "being helpful", "being open", "what I learned at CodingDojo!"],
el = document.getElementById('magic'),
word_counter = 0,
character_counter = 0;
function updateText()
{
var next_character = words[word_counter][character_counter++];
if(next_character == ' '){
@shtakai
shtakai / naive_user.rb
Created June 22, 2016 18:01
Naïve and simpler User validations
class User < ActiveRecord::Base
attr_accessible :name, :password, :password_confirmation
has_secure_password
validates :password, presence: true, confirmation: true, length: { minimum: 8 }
end
@shtakai
shtakai / S3Wrapper.cfc
Created November 9, 2016 02:23 — forked from christierney402/S3Wrapper.cfc
Amazon Web Services (AWS) S3 Wrapper for ColdFusion
/**
* Amazon S3 REST Wrapper
* Version Date: 2015-09-03
*
* Copyright 2015 CF Webtools | cfwebtools.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@shtakai
shtakai / gist:bcdb12b9d3fa1d2709b7f3987e65eff7
Created January 4, 2017 04:42 — forked from learncfinaweek/gist:4121390
Security - Secure Password Storage

The ARTISTS table in the cfartgallery datasource used for examples is an excellent example of how NOT to store passwords. First, they are stored in clear text and the column is limited to only 8 characters.

ARTISTID
@shtakai
shtakai / development.js
Created February 28, 2017 03:46 — forked from yuroyoro/development.js
webpakcer.gemにscssのビルドを加えて、大きめの依存ライブラリを別ファイルに分けて吐くようにしたwebpack.cnofig
// Note: You must restart bin/webpack-watcher for changes to take effect
var path = require('path')
var webpack = require('webpack')
var merge = require('webpack-merge')
var config = require('./shared.js')
var devconfig = {
devtool: 'sourcemap',
@shtakai
shtakai / development.js
Created February 28, 2017 03:46 — forked from yuroyoro/development.js
webpakcer.gemにscssのビルドを加えて、大きめの依存ライブラリを別ファイルに分けて吐くようにしたwebpack.cnofig
// Note: You must restart bin/webpack-watcher for changes to take effect
var path = require('path')
var webpack = require('webpack')
var merge = require('webpack-merge')
var config = require('./shared.js')
var devconfig = {
devtool: 'sourcemap',
@shtakai
shtakai / 0_reuse_code.js
Created May 15, 2017 08:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@shtakai
shtakai / spec_helper.rb
Created August 15, 2018 01:46 — forked from adamstegman/spec_helper.rb
Silence RSpec specs
RSpec.configure do |config|
config.before(:all, &:silence_output)
config.after(:all, &:enable_output)
end
# Redirects stderr and stdout to /dev/null.
def silence_output
@orig_stderr = $stderr
@orig_stdout = $stdout
@shtakai
shtakai / gist:6cb590247d2a4c11f51758d5e5d9b9d4
Created September 17, 2018 10:00 — forked from ryenus/gist:1518596
Using ruby in place of grep/awk/sed like perl

With options -e, -n, -p, perl can do what grep/awk/sed can, what about ruby?

Let's take the result of ls -l as input and process it with ruby

grep with ruby

\ls -l | ruby -ne 'print if /^d/'

awk with ruby

\ls -l | ruby -ne 'puts split(/\s+/).last if /^d/'