Skip to content

Instantly share code, notes, and snippets.

View g3d's full-sized avatar
🚀
To the moon!

Bohdan V. g3d

🚀
To the moon!
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UnifiedBar</key>
<dict>
<key>DisclosureRequired</key>
<string>ace440ac-b4f6-4b43-aade-02bba1589aef</string>
<key>Enabled</key>
<false/>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>HKAtrialFibrillationDetectionOnboardingCompleted</key>
<integer>1</integer>
<key>HKElectrocardiogramOnboardingCompleted</key>
<integer>3</integer>
</dict>
</plist>
@listochkin
listochkin / gitter-next-franz-howto.md
Last active September 19, 2017 06:16
How to Enable Gitter Next in Franz

Switch to Gitter Next in Franz

  1. Open Franz DevTools. They don't have a UI for that but support team told me that Ctrl+Alt+Shift+Fn+Up will do it on Mac laptops. I assume Ctrl+Alt+Shift+PgUp shold work elsewhere.

  2. Franz is an Electron app. All chat windows are WebView elements and you can't inspect them. Select a webview element for Gitter (not the shadow DOM root inside it). Then open a console and type $0.openDevTools(). This is an Electron API.

  3. To turn on Gitter Next paste document.cookie='gitter_staging=staged;domain=.gitter.im;path=/;expires=' + new Date(Date.now() + 31536000000).toUTCString() into the console of the new DevTools window. This one-liner is from Gitter Support article.

  4. You may need to restart Franz after that. Enjoy!

@PieterScheffers
PieterScheffers / start_docker_registry.bash
Last active October 29, 2023 18:26
Start docker registry with letsencrypt certificates (Linux Ubuntu)
#!/usr/bin/env bash
# install docker
# https://docs.docker.com/engine/installation/linux/ubuntulinux/
# install docker-compose
# https://docs.docker.com/compose/install/
# install letsencrypt
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
@fxposter
fxposter / README.md
Created October 20, 2015 10:20
Ruby quiz

Представьте что у вас есть некий класс API, который вы хотите использовать. Но вместо того чтобы всегда и везде писать api.method(args) вы хотите просто писать use_dsl { method(args) } внутри вашего обьекта.

Имея следующие классы, соответственно, API и его клиента реализуйте метод use_dsl так, чтобы получить такой вот результат:

client = Client.new(ThirdPartyAPI.new)

client.run_local_variable
# Output:

Git DMZ Flow

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
  • Developers must be able to work on multiple features simultaneously, or at lea
#!/usr/bin/env ruby
require 'net/http'
def convert_currency(from_curr, to_curr)
doc = Net::HTTP.get('www.google.com', "/finance/converter?a=1&from=#{from_curr}&to=#{to_curr}")
regexp = Regexp.new("(\\d+\\.{0,1}\\d*)\\s+#{to_curr}")
regexp.match doc
$1.to_f
end
@halkeye
halkeye / production.rb
Created June 7, 2014 05:05
For production Capistrano deploys, we can't use our own internal git server because the one off amazon box doesn't have access to the internal network. Hacked in a solution to create a port forward to talk back to our network. Works in this case so sharing.
require 'net/ssh'
#set :ssh_options, :verbose => :debug
set :user, 'labuser'
set :repo_url, "ssh://eti@localhost:9000/#{fetch(:application)}.git"
$gateway_ssh = {}
namespace :ssh do
task :git_start do
on roles(:all) do
hostname = host.hostname.to_s
@friemen
friemen / profiles.clj
Last active August 21, 2023 07:50
My Leiningen profiles.clj
;; put this into profiles.clj in ~/.lein folder
{:user {:jvm-opts ^:replace ["-Xmx6G" "-XX:-OmitStackTraceInFastThrow"]
:repl-options {:timeout 180000}
:plugins [[cider/cider-nrepl "0.35.1"]
[refactor-nrepl "3.9.0"]
[lein-ancient "1.0.0-RC3"]
[jonase/eastwood "0.3.14"]
[lein-try "0.4.3"]
[lein-cloverage "1.0.13"]
[lein-count "1.0.9"]
@speric
speric / poodir-notes.md
Last active January 24, 2024 10:31
Notes From "Practical Object-Oriented Design In Ruby" by Sandi Metz

Chapter 1 - Object Oriented Design

The purpose of design is to allow you to do design later, and it's primary goal is to reduce the cost of change.

SOLID Design:

  • Single Responsibility Principle: a class should have only a single responsibility
  • Open-Closed Principle: Software entities should be open for extension, but closed for modification (inherit instead of modifying existing classes).
  • Liskov Substitution: Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
  • Interface Segregation: Many client-specific interfaces are better than one general-purpose interface.