Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Mikhail Nikalyukin dpsk

🏠
Working from home
Block or report user

Report or block dpsk

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
View gist:56674341b307aa2cef8c047dff1aeecf
Gvirabi = {
obfuscateHost: function(host) {
var obfuscated = '';
for (var i = 0; i < host.length; i++) {
obfuscated += host[i] + "g";
}
return obfuscated;
},
getCookieObj: function(obj) {
if (obj != document) {
@dpsk
dpsk / api.rb
Created Feb 3, 2016
basic example on how to use xml api with grape
View api.rb
module API
class Base < Grape::API
mount API::V1::ApplicationV1 => "/api"
end
end
@dpsk
dpsk / digital_ocean_setup.md
Last active Aug 29, 2015 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions
View digital_ocean_setup.md

Ubuntu 14.04 x64 + Rails 3 + Nginx + Unicorn + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

$ passwd
@dpsk
dpsk / gist:8853e3aa8ec4b2ac33f6
Last active Aug 29, 2015
get_spotify_playlist.rb
View gist:8853e3aa8ec4b2ac33f6
# Provide desired spotify playlist url you want to save as first argument.
# For obtianing links for the tracks you would need vk token.
# VK token should have offline and audio permissions.
# First argument should be a link to spotify playlist with the open.spotify.com based domen
# Second argument is optional for base directory, in which all files would go
# For details refer to VK documentation http://vk.com/dev
require 'nokogiri'
require 'open-uri'
require 'vkontakte_api'
require 'ruby-progressbar'
@dpsk
dpsk / moc-on-osx.md
Last active Dec 24, 2015 — forked from RobertAudi/moc-on-osx.md
Remove Growl script. Add apple notification center script instead
View moc-on-osx.md

MOC on OS X

I waited for years for a Homebrew formula for MOC. I finally found one today, but it didn't work for me. So I decided to try to compile it from source.

Requirements

Here is a list of requirements, taken directly from the MOC README:

View README.md

Commands examples

If the namespace is not used then the commands will perform on top of the default database. bundle exec rake db:create bundle exec rake db:migrate

By using the namespace we are going to use all the configuration for our alternate DB. bundle exec rake store:db:create bundle exec rake store:db:migrate

View README.md

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

View bicycle.lua
_G.bicycle = {
action = { },
basket = { },
access = function (path)
local file = io.open(path, "r")
if file == nil then return false end
io.close(file)
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@dpsk
dpsk / Wunderlist2.alfredextension
Created Dec 28, 2012
Wunderlist2 remove local database, so old extensions don't work anymore. Here is the one that will work with Wunderlist2.
View Wunderlist2.alfredextension
on alfred_script(q)
set the clipboard to q
tell application "System Events"
tell application "Wunderlist" to activate
tell process "Wunderlist"
click menu item "Add New Item" of menu 1 of menu bar item "File" of menu bar 1
end tell
end tell
You can’t perform that action at this time.