Skip to content

Instantly share code, notes, and snippets.

View merqlove's full-sized avatar

Alexander Merkulov merqlove

View GitHub Profile
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1
@merqlove
merqlove / config.ex
Last active July 30, 2016 17:20 — forked from bitwalker/config.ex
Useful config wrapper for Elixir
defmodule Config do
@moduledoc """
This module handles fetching values from the config with some additional niceties
"""
@default_app_name :some_app
@default_endpoint SomeApp.Endpoint
@doc """
Fetches key from the default endpoint config, and prepare it with _get/3.
@merqlove
merqlove / iconv_install_ubuntu14.sh
Last active August 25, 2021 10:28 — forked from paulczar/gist:5493708
Install libiconv on Ubuntu 14.04
--- srclib/stdio.in.h.orig 2011-08-07 16:42:06.000000000 +0300
+++ srclib/stdio.in.h 2013-01-10 15:53:03.000000000 +0200
@@ -695,7 +695,9 @@
/* It is very rare that the developer ever has full control of stdin,
so any use of gets warrants an unconditional warning. Assume it is
always declared, since it is required by C89. */
-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
#!/usr/bin/env elixir
defmodule Committer do
defstruct [:name, :email]
def list(repo) do
repo
|> from_repo
|> Stream.unfold(fn str ->
case String.split(str, "\n", parts: 2, trim: true) do
@merqlove
merqlove / Dockerfile
Last active August 29, 2015 14:28 — forked from mokevnin/Dockerfile
hexlet.io: configuration management and deploy
FROM ruby:2.2.1
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
ENV RAILS_ENV production
ENV REFILE_CACHE_DIR /var/tmp/uploads
RUN curl -sL https://deb.nodesource.com/setup | bash -
describe('e2e: main', function() {
var ptor;
beforeEach(function() {
browser.get('/');
ptor = protractor.getInstance();
});
it('should load the home page', function() {
# Karma configuration
# Generated on Tue Aug 20 2013 16:26:25 GMT-0400 (EDT)
module.exports = (config) ->
config.set
# base path, that will be used to resolve all patterns, eg. files, exclude
basePath: '..'
# frameworks to use
@merqlove
merqlove / app.rb
Created January 28, 2014 01:22 — forked from hendrikswan/app.rb
require 'sinatra'
require 'mongoid'
require 'json'
require "sinatra/reloader" if development?
Mongoid.load!("mongoid.yml")
class Price
include Mongoid::Document
#!/usr/bin/env bash
set -o errtrace
set -o errexit
facter_version=$1
puppet_version=$2
target_volume=$3

ruby-1.9.3 cumulative performance patch for rbenv

(I guarantee nothing. No warranty I am not responsible blah blah blah. Seems to work great for me so far. Thanks to Tyler Bird and Slayer who I forked this from.)

From merqlove:

I just made little improvement to this fix:

Now you can select Ruby BUILD via same name variable. Otherwise build version will be used by default.