In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal
In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG | |
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT. | |
# | |
# | |
# Libraries and infrastructure | |
sudo apt update -y | |
sudo apt install -y \ | |
docker.io docker-buildx \ | |
build-essential pkg-config autoconf bison rustc cargo clang \ |
name: Update Campfire Source | |
on: | |
schedule: | |
- cron: "0 4 * * *" | |
workflow_dispatch: | |
jobs: | |
update: | |
runs-on: ubuntu-latest |
Example of Kamal deployment from Github Actions.
Add your applications .env
variables to the Github repo as a repository secret, you can find this under the repo settings => secrets and variables => actions
https://github.com/username/repo_name/settings/secrets/actions
you are going to need an ssh private key that your deployment server is aware of (add public key to servers .ssh/authorized_keys) and add the ssh private key as a repo secret
create action workflows
require 'redis' | |
require 'redis-namespace' | |
class Limiter | |
def initialize(name:, threshold:, interval:, time_span: 600, bucket_span: 5) | |
@name, @threshold, @interval, @time_span, @bucket_span = name, threshold, interval, time_span, bucket_span | |
raise ArgumentError if @interval > @time_span || @interval < @bucket_span | |
@redis ||= Redis::Namespace.new(:limiter, redis: $redis || Redis.new) |
My largest Sidekiq application had a memory leak and I was able to find and fix it in just few hours spent on analyzing Ruby's heap. In this post I'll show my profiling setup.
As you might know Ruby 2.1 introduced a few great changes to ObjectSpace, so now it's much easier to find a line of code that is allocating too many objects. Here is great post explaining how it's working.
I was too lazy to set up some seeding and run it locally, so I checked that test suite passes when profiling is enabled and pushed debugging to production. Production environment also suited me better since my jobs data can't be fully random generated.
So, in order to profile your worker, add this to your Sidekiq configuration:
if ENV["PROFILE"]
In order to make it easier to verify Active Record bugs you are encouraged to file bug report using one of the templates mentioned below .
If you are using published versions of gems then all you need to create is a single gist file like this .
If you are using master version of rails then use this template . Note that in this case both Gemfile and test file are needed .
require 'rubygems' | |
require 'benchmark' | |
require 'httparty' | |
@picasa_user = '117499753694301708125' | |
class XmlFetcher | |
include HTTParty | |
format :xml | |
end |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
This script only works for older versions of Spotify for Linux.
An actively developed admute script for Spotify on Linux can be found here: https://github.com/SecUpwN/Spotify-AdKiller