Skip to content

Instantly share code, notes, and snippets.

View lanadz-shopify's full-sized avatar
🕶️

Lana Dzyuban lanadz-shopify

🕶️
View GitHub Profile
@lanadz-shopify
lanadz-shopify / git-find-me-the-fucking-deleted-file.sh
Created February 9, 2023 18:36 — forked from joakin/git-find-me-the-fucking-deleted-file.sh
finding a deleted file in a git repository
# If you don't remember the exact path/name, search the log for deleted files
git log --diff-filter=D --summary | grep delete
# Find the file you want to get from the ouput, and use the path
# Find the commits that involved that path
git log --all -- some/path/to/deleted.file
# Bring the file back to life to the current repo (sha commit of parent of commit that deleted)
git checkout shaofthecommitthatdeletedthefile^ -- some/path/to/deleted.file
@lanadz-shopify
lanadz-shopify / Convert PostgreSQL to SQLite
Created December 17, 2022 04:59 — forked from fiftin/Convert PostgreSQL to SQLite
Convert PostgreSQL to SQLite
1. Dump the data only sql to file
$ pg_dump --data-only --inserts YOUR_DB_NAME > dump.sql
2. scp to local
3. Remove the SET statements at the top
such as:
SET statement_timeout = 0;
SET client_encoding = 'SQL_ASCII';
4. Remove the setval sequence queries
getFebDays(year: number): number {
const isLeapYear = (year % 100 === 0) ? (year % 400 === 0) : (year % 4 === 0);
return isLeapYear ? 29 : 28;
}
config.action_mailer.delivery_method = :smtp
# SMTP settings for Gmail
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:user_name => ENV['gmail_username'],
:password => ENV['gmail_password'],
:authentication => "plain",
:enable_starttls_auto => true }
Mailgun.configure do |config|
config.api_key = 'your-secret-api-key'
end
/* class applies to select element itself, not a wrapper element */
.select-css {
display: block;
font-size: 16px;
font-family: sans-serif;
font-weight: 700;
color: #444;
line-height: 1.3;
padding: .6em 1.4em .5em .8em;
width: 100%;
@lanadz-shopify
lanadz-shopify / postgres-brew.md
Created December 20, 2018 07:38 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@lanadz-shopify
lanadz-shopify / transition.css
Created August 9, 2018 14:04
trasition animation
.sf-page {
-webkit-transition: -webkit-transform .2s ease-out;
}
.sf-page.out {
-webkit-transform: translateX(240px);
}
// Or, through animations like so:
@lanadz-shopify
lanadz-shopify / remove.js
Created December 14, 2017 15:07
JS: remove by key-val
function removeByKey(array, params){
array.some(function(item, index) {
if(array[index][params.key] === params.value){
array.splice(index, 1);
return true; // stops the loop
}
return false;
});
return array;
}
@lanadz-shopify
lanadz-shopify / all.js
Created November 28, 2017 03:04
Vue simple login with router
var About = { template: '<h1>About</div>' };
var Dashboard = { template: '<h1>Dashboard</h1>' };
var Auth = {
loggedIn: false,
login: function() { this.loggedIn = true },
logout: function() { this.loggedIn = false }
};
var Login = {