Skip to content

Instantly share code, notes, and snippets.

View sasharevzin's full-sized avatar
🏠
Working from home

Sasha sasharevzin

🏠
Working from home
  • New York, NY
View GitHub Profile
@AtulKsol
AtulKsol / db_backup_commands.md
Last active February 21, 2024 14:39
Commands to backup & restore database
  1. pg_dump is a nifty utility designed to output a series of SQL statements that describes the schema and data of your database. You can control what goes into your backup by using additional flags.
    Backup: pg_dump -h localhost -p 5432 -U postgres -d mydb > backup.sql

    Restore: psql -h localhost -p 5432 -U postgres -d mydb < backup.sql

    -h is for host.
    -p is for port.
    -U is for username.
    -d is for database.

@bearded-avenger
bearded-avenger / devise.rb
Last active January 11, 2022 17:04
Rails - SSO - WordPress - Authenticating against a WordPress install from a Rails site using oAuth
config.omniauth :wordpress_hosted, ENV['SSO_KEY'], ENV['SSO_SECRET'],
strategy_class: OmniAuth::Strategies::WordpressHosted,
client_options: { site: ENV['SSO_URL'] }
@xissy
xissy / getYoutubeVideoInfo.coffee
Last active November 29, 2023 18:09
Get a youtube video information from get_video_info.
request = require 'request'
youTubeMovieInfo =
youTubeMovieId: 'videoId'
url = "http://www.youtube.com/get_video_info?video_id=#{youTubeMovieInfo.youTubeMovieId}"
request.get url, (err, res, body) ->
return callback(false) if err
return callback(false) if res.statusCode isnt 200