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
#!/bin/ash | |
# Credits to Kevin Kofler | |
# https://forum.pine64.org/showthread.php?tid=16539&pid=109333#pid109333 | |
if [ -z "$1" ] ; then | |
echo "usage: ./record.sh videoname" | |
exit 1 | |
fi |
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 "rspec/autorun" | |
class FizzBuzz | |
def call | |
end | |
end | |
describe FizzBuzz do | |
let(:subject) { FizzBuzz.new } |
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
module Site exposing (..) | |
import Browser exposing (Document, UrlRequest) | |
import Browser.Navigation exposing (Key) | |
import Url exposing (Url) | |
type alias Flags = | |
{} |
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
# starting a new rails app | |
# - use minitest | |
# - use postgresql | |
rails new MyApp --database=postgresql | |
# install helpful gems | |
bundle add slim-rails | |
bundle add shoulda-context -g test | |
bundle add shoulda-matchers -g test |
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
# Enumerator is a very powerful feature if you know how to use it. The most | |
# powerful part of Enumerator is the possibility of chaining them. Take some | |
# time to understand the intricacies of it because it is not very well | |
# documented. Some awesome references that I found are listed below. Note that | |
# I didn't understand when reading any of them right off the bat. Read a few, | |
# dig some documentation and experiment for yourself to get the "fuller" | |
# picture. | |
# | |
# [1]: https://blog.arkency.com/2014/01/ruby-to-enum-for-enumerator/ | |
# [2]: https://stackoverflow.com/a/9194052 |
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
/* | |
Converting JSON file | |
{ | |
"one": "1", | |
"two": "2" | |
} | |
to JavaScript Object | |
{ | |
one: "1", |
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
# start a shell inside the image | |
docker run -it -e ENV1=VALUE1 image-name:image-tag /bin/sh |
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 "graphql/client" | |
require "graphql/client/http" | |
require "pry" | |
module GitHub | |
HTTP = GraphQL::Client::HTTP.new("https://api.github.com/graphql") do | |
def headers(context) | |
{ "Authorization": "Bearer #{ENV['personal_access_token']}" } | |
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
# The purpose is to create a Gem that has a dummy rails application and uses RSpec as the test framework. | |
# Check whether gem name is given. | |
if ARGV.length != 1 | |
puts "ERROR: We need exactly one parameter. The name of a gem. Eg. MyGem" | |
exit; | |
end | |
# Initializing dependencies and utilities | |
require 'active_support/inflector' |