Skip to content

Instantly share code, notes, and snippets.

melnikaite melnikaite

Block or report user

Report or block melnikaite

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@melnikaite
melnikaite / yandex.radio.bttpreset
Created Jul 16, 2019
adds to touch bar button to next track and to like song on yandex radio in chrome browser
View yandex.radio.bttpreset
{
"BTTPresetName" : "Default",
"BTTPresetUUID" : "153FFA02-38FC-4862-B91A-24CB898C9B55",
"BTTPresetContent" : [
{
"BTTAppBundleIdentifier" : "BT.G",
"BTTAppName" : "Global",
"BTTAppAutoInvertIcon" : 1,
"BTTAppSpecificSettings" : {
View bls.js
const bls = require('bls-lib');
bls.onModuleInit(() => {
bls.init();
const numOfPlayers = 7;
const threshold = 3;
const msg = 'hello world';
console.log({numOfPlayers, threshold, msg});
// set up master key share
@melnikaite
melnikaite / enable.rb
Created Oct 13, 2016
enable JSON functions in SQLite
View enable.rb
# To enable JSON functions in SQLite run in irb
require 'sqlite3'
c = SQLite3::Database.new('database')
c.enable_load_extension(1)
c.load_extension('/usr/local/Cellar/sqlite/3.14.2/lib/libsqlitefunctions.dylib')
View r.csv
Benchmark activerecord-mysql activerecord-postgresql activerecord-sqlite mongoid-mongodb sequel-mysql sequel-postgresql sequel-sqlite
Eager Loading Query Per Association With 1-1 Records: 640 objects 22 times-No Transaction 5.921149 6.284935 5.860397 1.314835 0.254055 0.283381 0.356529
Eager Loading Query Per Association With 1-1 Records: 640 objects 22 times-Transaction 6.012105 6.493957 5.738628 0.253842 0.282353 0.376487
Eager Loading Query Per Association With 1-32 Records: 1024 objects 22 times-No Transaction 1.087165 1.114392 1.037673 0.908334 0.190097 0.206294 0.273892
Eager Loading Query Per Association With 1-32 Records: 1024 objects 22 times-Transaction 1.085952 1.150046 1.015849 0.191712 0.212131 0.271282
Eager Loading Query Per Association With 1-32-32 Records: 2048 objects 9 times-No Transaction 0.848494 0.894651 0.810860 0.082494 0.168703 0.170906 0.239950
Eager Loading Query Per Association With 1-32-32 Records: 2048 objects 9 times-Transaction 0.835610 0.867175 0.787067 0.168840 0.171462 0.
@melnikaite
melnikaite / gist:f0730dc6ade93ec83527
Created Oct 3, 2014
create yml file from ENV variable
View gist:f0730dc6ade93ec83527
# remove all unused environments from applicationюньд and generate hash
ruby -e 'require "yaml"; puts YAML.load(File.read("config/application.yml"))'
# run script to create yml file
application_yml='{"test"=>{"protocol"=>"https", "host"=>"example.com"}}' ruby -e 'require "yaml"; File.open("config/application.yml", "w") {|f| f.write(eval(ENV["application_yml"]).to_yaml) }'
View assets.rake
# lib/capistrano/tasks/assets.rake
Rake::Task['deploy:assets:precompile'].clear
namespace :deploy do
namespace :assets do
desc 'Precompile assets locally and then rsync to remote servers'
task :precompile do
local_manifest_path = %x{ls public/assets/manifest*}.strip
@melnikaite
melnikaite / bootstrap-fileupload.js
Created Jun 13, 2013
client-side-validations-formtastic jasny bootstrap fileupload image input
View bootstrap-fileupload.js
//conflict with ClientSideValidations
//this.$input.attr('name', this.name)
You can’t perform that action at this time.