Skip to content

Instantly share code, notes, and snippets.

View bioform's full-sized avatar

Andrew Krasnoff bioform

View GitHub Profile
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
call.dial("+19197414205",{
answer: function(call1) {
log.info("The other side picked up")
call1.say("Thanks for calling")
call.pause(10);
call1.hangup();
},
hangup: function(call1) {
log.info("Call finished.")
}
call.dial("+19197414205",{
answer: function(call) {
call.say("Thanks for calling. Press one please")
var key = call.get_keypress()
call.say("You pressed " + key);
}
})
@bioform
bioform / migrations.js
Created March 19, 2013 16:37
Rails like migrations for CompoundJS. Put this code to "/config/initializers/migrations.js"
var migrate = require('migrate')
, join = require('path').join
, fs = require('fs');
module.exports = function(compound) {
var app = compound.app;
var options = {args: []};
/**
* Migration template.
@bioform
bioform / gist:2db00f5d2cb8c53e8ff0e365edeb3b68
Created December 26, 2017 09:59 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@bioform
bioform / clear-sidekiq-jobs.sh
Created October 3, 2018 10:42 — forked from wbotelhos/clear-sidekiq-jobs.sh
Clear Sidekiq Jobs
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
# 3. Clear 'Processed' and 'Failed' jobs
Hi! Ping! I'm here to request a review from you guys in this PR (https://github.com/toptal/platform/pull/29923).
To make it easier for you to review it, here's the list of files in your domain that we touched:
--------------------------------------------
app/models/talent.rb
If you see more files which are in your domain - update
https://github.com/toptal/platform/blob/master/.github/CODEOWNERS
please.
Thanks in advance! :high-five:
#!/bin/bash
TEAM=$1
BRANCH=$2
OWNED_PATTERNS=$(cat ./.github/CODEOWNERS|grep @toptal/$TEAM |cut -d' ' -f1| sed -e 's/^/\.\//')
OWNED_FILES=`git ls-files $OWNED_PATTERNS`
git fetch origin $BRANCH:$BRANCH
CHANGED_FILES=`git diff --name-only $BRANCH $(git merge-base $BRANCH origin/master)`
echo "--------------------------------------------"
@bioform
bioform / mailhog-install.md
Created January 25, 2020 13:46 — forked from viktorpetryk/mailhog-install.md
MailHog installation on Ubuntu

Install & Configure MailHog

  1. Download and make it executable
wget https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64
sudo cp MailHog_linux_amd64 /usr/local/bin/mailhog
sudo chmod +x /usr/local/bin/mailhog
  1. Make MailHog as a service
@bioform
bioform / revert-a-commit.md
Created February 3, 2020 16:42 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32: