Skip to content

Instantly share code, notes, and snippets.

To transfer a directory from one Git repository to another while preserving its history, follow these steps:

  1. Clone the SOURCE REPOSITORY to your local machine.
  2. Remove the origin from the local copy of the SOURCE REPOSITORY.
git remote remove origin
  1. Use Git filter-repo to filter the repository's history to include only the files you need, specifying the DIRECTORY_PATH.
def speech_sync_recognize(audio_file_path: nil, language_code: "en-US", profanity_filter: false)
# [START speech_transcribe_sync]
# audio_file_path = "Path to file on which to perform speech recognition"
require "google/cloud/speech"
speech = Google::Cloud::Speech.speech
# [START speech_ruby_migration_sync_response]
audio_file = File.binread audio_file_path
require "json"
require "time"
module HashToOpenApiSchema
def self.get_type(value)
Time.parse(value)
"date-time"
rescue
case value
when TrueClass
"boolean"
#!/bin/bash -eo pipefail
###############
# Begin Collecting
###############
DATA_URL="https://circleci.com/api/v2/workflow/$CIRCLE_WORKFLOW_ID/job?circle-token=$CIRCLE_TOKEN"
WF_DATA=$(curl -s "$DATA_URL")
WF_MESSAGE=$(echo "$WF_DATA" | jq '.message')
# Exit if no Workflow.
if [ "$WF_MESSAGE" = "\"Workflow not found\"" ];
then
require "google/apis/calendar_v3"
require "googleauth"
require "googleauth/stores/file_token_store"
require "date"
require "fileutils"
require "active_support/all"
OOB_URI = "urn:ietf:wg:oauth:2.0:oob".freeze
APPLICATION_NAME = "Google Calendar API Ruby Quickstart".freeze
CREDENTIALS_PATH = "credentials.json".freeze

Hello

kansdkjdnasl kajsndjk

require 'octokit'
token = "TOKEN"
repo_name = "REPO NAME"
milestone = 0
client = Octokit::Client.new(access_token: token)
client.list_issues(repo_name, milestone: milestone, state: :all)
client.milestones(repo_name, state: :all).
COMMENTS_SCORE = 1
BOOKMARK_SCORE = 2
COOKS_SCORE = 3
task :build_top_fans do |_, args|
user_id = args[:user_id]
redis_client = Redis.new(configurations)
top_fan_ids_with_scores = group_by_id_and_sum_scopres( bookmarker_fan_ids_with_score(user_id) +
commenters_fan_ids_with_scope(user_id) +
task :build_top_fans do |_, args|
user_id = args[:user_id]
redis_client = Redis.new(configurations)
top_fan_ids = bookmarker_fan_ids(user_id) +
commenters_fan_ids(user_id) +
cooker_fan_ids(user_id)
top_fan_ids.each do |id|
redis_client.sadd("top-fans:#{user_id}", id)
task :build_top_fans do |_, args|
user_id = args[:user_id]
redis_client = Redis.new(configurations)
top_fan_ids = (
bookmarker_fan_ids(user_id) +
commenters_fan_ids(user_id) +
cooker_fan_ids(user_id)
).uniq