View .vimrc
This file contains 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
" ============================================================================= | |
" Miller Medeiros .vimrc file | |
" ----------------------------------------------------------------------------- | |
" heavily inspired by: @factorylabs, @scrooloose, @nvie, @gf3, @bit-theory, ... | |
" ============================================================================= | |
" ----------------------------------------------------------------------------- | |
" BEHAVIOR |
View substrings.rb
This file contains 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
# Implement a method #substrings that takes a word as the first argument and then | |
# an array of valid substrings (your dictionary) as the second argument. | |
# It should return a hash listing each substring (case insensitive) that was found | |
# in the original string and how many times it was found. | |
``` | |
> substrings("Howdy partner, sit down! How's it going?", dictionary) | |
=> { "down" => 1, "how" => 2, "howdy" => 1,"go" => 1, "going" => 1, "it" => 2, "i" => 3, "own" => 1,"part" => 1,"partner" => 1,"sit" => 1 } | |
``` | |
dictionary = ["below","down","go","going","horn","how","howdy","it","i","low","own","part","partner","sit"] |
View ceasar_cipher.rb
This file contains 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
puts "Welcome!" | |
puts "Please enter the phrase you wish to encrypt: " | |
phrase = gets.chomp | |
puts "Enter factor: " | |
factor = gets.chomp.to_i | |
ALPHABETS = { | |
'lower' => [nil, ('a'..'z').to_a].flatten, | |
'upper' => [nil, ('A'..'Z').to_a].flatten | |
} |
View nuxt.config.js
This file contains 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
module.exports = { | |
/* | |
** Router config | |
*/ | |
router: { | |
middleware: ['namespace', 'check-auth'] | |
}, | |
/* | |
** Headers of the page | |
*/ |
View package.json
This file contains 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
{ | |
"name": "hl-student-web", | |
"version": "1.0.0", | |
"description": "Web Client", | |
"author": "Syed Aslam", | |
"engines": { | |
"node": "6.11.0", | |
"npm": ">=3.10.10", | |
"yarn": ">=0.27.5" | |
}, |
View stacktrace
This file contains 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
nuxt:build Building... +0ms | |
[AXIOS] Base URL: https://now-staging.hl.com/ , Browser: https://now-staging.hl.com/ | |
nuxt:build App root: /Users/aslam/Work/hl-student-web +0ms | |
nuxt:build Generating /Users/aslam/Work/hl-student-web/.nuxt files... +0ms | |
nuxt:build Generating files... +5ms | |
nuxt:build Generating routes... +17ms | |
nuxt:build Building files... +26ms | |
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. | |
- configuration.module.rules[2].use should be one of these: | |
non-empty string | function | object { loader?, options?, query? } | function | [non-empty string | function | object { loader?, options?, query? }] |
View generate-pushid.js
This file contains 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
/** | |
* Fancy ID generator that creates 20-character string identifiers with the following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
* latter ones will sort after the former ones. We do this by using the previous random bits | |
* but "incrementing" them by 1 (only in the case of a timestamp collision). | |
*/ |
View varnish3.rb
This file contains 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
## | |
# Install Varnish 3.0.2 on OSX with the following Brew command: | |
# $> brew install https://gist.githubusercontent.com/aslam/022ec19fb9b1b1b96c99c09b2f43d9c3/raw/d731e4bb44830a352397e3cb79f1aea47bed6483/varnish3.rb | |
# | |
# You also might have to run: | |
# $> sudo brew link varnish3 | |
# To symlink the install. | |
## | |
require 'formula' |
View gist:f27929409f5ee6a2a8e2
This file contains 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
#/usr/bin/env bash | |
rm -rf ./.pngs | |
rm -rf ./.gifs | |
mkdir .pngs | |
mkdir .gifs | |
ffmpeg -i $1 -r 10 ./.pngs/out%04d.png | |
sips -s format gif ./.pngs/*.png --out ./.gifs | |
gifsicle ./.gifs/*.gif --optimize=3 --delay=3 --loopcount --resize 720x405 --colors=255 > $1.gif | |
gifsicle --unoptimize $1.gif | gifsicle --dither --colors 48 --resize-fit-width 512 -O2 `seq -f "#%g" 0 2 213` -o $1.optimized.gif | |
rm -rf $1.gif |
View deploy.rake
This file contains 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 'jammit' | |
namespace :deploy do | |
def run(*cmd) | |
system(*cmd) | |
raise "Command #{cmd.inspect} failed!" unless $?.success? | |
end | |
task :prod do |
NewerOlder