Skip to content

Instantly share code, notes, and snippets.

View lisasy's full-sized avatar

Lisa Sy lisasy

View GitHub Profile
$breakpoints: 'sm', 'md', 'lg', 'xl', '2xl';
@mixin breakpointSet($breakpoints) {
@media (min-width: theme('screens.' + #{$breakpoints})) {
@content;
}
}
.boxContainer {
margin: 20px;
@lisasy
lisasy / gist:b03ab465ae303c19ff6a8938270ef20e
Created September 30, 2020 19:49
Boilerplate Notification (Forem)
me = User.find_by(username: "lisasy")
3.times do |i|
follow = Follow.create!(followable: me, follower: User.find(i+1))
follow_data = follow.attributes.slice("follower_id", "followable_id", "followable_type").symbolize_keys
Notification.send_new_follower_notification_without_delay(follow)
end
BadgeAchievement.last.update(user_id: me.id)
Notifications::NewBadgeAchievement::Send.call(BadgeAchievement.last)
@lisasy
lisasy / date-format.rb
Created December 5, 2014 18:38
Ruby date format method
# Outputs date in format: "March 16, 2003"
def format_date(date)
date.strftime("%B %e, %Y")
end
# Use in view file this way:
<%= format_date(article.timestamp) %>
@lisasy
lisasy / gituations.markdown
Last active August 29, 2015 14:09
Git helpers
  • What is remote?
  • What is local?

I want to take a branch that is remote and bring it onto my machine.

git checkout -b branch_name origin/branch_name

Before I want to push my local branch remote, I want to make sure I get the most updated information from Mars.

$(function() {
var $stickyEl = $("[data-waypoint='nav']");
var $stopEl = $("[data-waypoint='footer']");
var $verticalGutter = $stopEl.outerHeight()
$stickyEl.waypoint("sticky", function() {
$("[data-waypoint='main']").toggleClass("stuck");
});
$stopEl.waypoint(function (direction) {
@lisasy
lisasy / _columns.scss
Last active August 29, 2015 14:05
Multiple Columns with Neat
$column-num: col !default;
@for $i from 2 through 4 {
.#{$column-num}-#{$i} {
overflow: hidden;
.column {
@include fill-parent();
@include media($medium-screen) {
@lisasy
lisasy / application.html.haml
Last active August 29, 2015 13:57
Nested application layouts for Rails projects
!!!
%html
%head
%meta{:charset => "utf-8"}
%meta{:content => "NOODP", :name => "ROBOTS"}
%meta{name: 'viewport', content: 'width=device-width; initial-scale=1.0; maximum-scale=1.0;'}
%title= page_title
= stylesheet_link_tag :application, :media => 'all'
= csrf_meta_tags
%body{:class => body_class}
%header.site-header
.header-content
.search-content
%section.container
%aside
%nav
%ul
%li
%a
@lisasy
lisasy / _equal-gutter.scss
Created March 2, 2014 23:39
_equal-gutter.scss
@mixin equal-gutter($direction: top, $value: 1em) {
padding-#{$direction}: $value;
margin-#{$direction}: $value;
}
@lisasy
lisasy / _nubbed.scss
Created October 28, 2013 21:26
Custom nub arrow
div.nub {
border-bottom: 16px solid rgb(250,250,250);
border-left: 16px solid transparent;
border-right: 16px solid transparent;
content: '';
height: 0;
margin-left: -16px;
position: absolute;
top: -16px;
width: 0;