Skip to content

Instantly share code, notes, and snippets.

View nisevi's full-sized avatar
🧑‍🚀
Working from anywhere

Nicolas Sebastian Vidal nisevi

🧑‍🚀
Working from anywhere
View GitHub Profile
@nisevi
nisevi / config.yml
Last active January 24, 2024 04:27
CircleCI 2.0 deploy to S3 static website - configuration file.
version: 2
jobs:
build:
working_directory: /tmp/vasko
docker:
- image: circleci/python:3.6.2-stretch-browsers
steps:
- checkout
- run:
name: Deploying Vasko.
@nisevi
nisevi / puller.rb
Last active July 20, 2020 00:26
Recursively iterate over all subfolders and execute 'git pull' on all paths that have '.git'
#!/usr/bin/env ruby
class PathManager
DEFAULT_DIRECTORY = '.'
attr_accessor :base_directory, :invalid_filenames
def initialize(args = {})
self.base_directory = expand_path(args.fetch(:base_directory, DEFAULT_DIRECTORY))
self.invalid_filenames = args[:invalid_filenames]
@nisevi
nisevi / cloner.py
Created July 19, 2020 23:41
Clone all repositories from a given Organization
import os
from github import Github
g = Github("token-goes-here")
org = g.get_organization("organization-name-goes-here")
repos = org.get_repos()
for repo in repos:
cmd = "git clone {}".format(repo.ssh_url)
@nisevi
nisevi / string_spec.rb
Created May 3, 2019 14:52
Spec for covering the new methods
# frozen_string_literal: true
require_relative "../../../lib/thanoscase/string"
RSpec.describe "String class" do
it "should shorten an even string to half its size" do
expect("1234".thanoscase.length).to eq(2)
end
it "should shorten an odd string to half its size plus 1" do
@nisevi
nisevi / Gemfile
Last active May 3, 2019 14:33
Gemfile for adding RSpec to our gem
source 'https://rubygems.org'
gemspec
@nisevi
nisevi / thanoscase.gemspec
Created May 3, 2019 14:27
Gemspec file with the addition of RSpec library
# frozen_string_literal: true
Gem::Specification.new do |s|
s.name = "thanoscase"
s.version = "0.0.1"
s.date = "2019-04-27"
s.summary = "Thanos gem"
s.description = "Randomly removes half the characters of a given string."
s.authors = ["Nicolas Sebastian Vidal"]
s.email = "nicolas.s.vidal@gmail.com"
@nisevi
nisevi / config.yml
Created May 3, 2019 04:42
Basic RSpec coverage with CircleCI
version: 2.1
commands:
cached-bundle:
steps:
- restore_cache:
keys:
- gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
- gem-cache-v1-{{ arch }}-{{ .Branch }}
- gem-cache-v1
- run: bundle install --path vendor/bundle
@nisevi
nisevi / thanoscase.gemspec
Last active May 3, 2019 04:40
Gemspec file, our interface to RubyGems
# frozen_string_literal: true
Gem::Specification.new do |s|
s.name = "thanoscase"
s.version = "0.0.1"
s.date = "2019-04-27"
s.summary = "Thanos gem"
s.description = "Randomly removes half the characters of a given string."
s.authors = ["Nicolas Sebastian Vidal"]
s.email = "nicolas.s.vidal@gmail.com"
@nisevi
nisevi / thanoscase.rb
Created May 1, 2019 17:47
File for importing the archives inside lib folder
# frozen_string_literal: true
require "thanoscase/string"
@nisevi
nisevi / file_structure.txt
Last active May 1, 2019 17:28
Basic file structure for creating a gem
% tree thanoscase
thanoscase/
├── lib/
│ └── thanoscase/
│ └── string.rb
│ └── thanoscase.rb
└── thanoscase.gemspec