Skip to content

Instantly share code, notes, and snippets.

View bhalash's full-sized avatar
💭
🌈

Mark bhalash

💭
🌈
View GitHub Profile
@bhalash
bhalash / input.scss
Created November 22, 2021 15:47
Generated by SassMeister.com.
@use 'sass:map';
$spacers: (
0: 0,
1: 0.25rem,
2: 0.5rem,
3: 1rem,
4: 1.5rem,
5: 2.75rem,
6: 3rem,
@bhalash
bhalash / input.scss
Created November 22, 2021 13:17
Generated by SassMeister.com.
@use 'sass:map';
$spacers: (
0: 0,
1: 0.25rem,
2: 0.5rem,
3: 1rem,
4: 1.5rem,
5: 2.75rem,
6: 3rem,
@bhalash
bhalash / SassMeister-input.scss
Last active December 13, 2019 16:59
Modular Scale Functions
// ----
// libsass (v3.2.5)
// ----
// Validated against http://www.modularscale.com/
// http://www.modularscale.com/?1&&1.5&web&text
$mod-scale--size: 1rem !default;
$mod-scale--ratio: 1.5 !default;
@function modular-scale($increment, $base-size, $ratio) {
@bhalash
bhalash / AngularDateHttpInterceptor.ts
Last active January 24, 2019 15:47 — forked from martinobordin/AngularRxJs5DateHttpInterceptor.ts
An Angular (> 4.3) interceptor to parse dates from server response.
/**
* Recursively walk HttpResponse object to cast ISO 8601-formatted dates as
* Moment.js objects.
*
* @see https://git.io/fNzJw
* @see https://www.npmjs.com/package/is-iso-date
* @see https://www.npmjs.com/package/traverse
*/
import { Injectable } from '@angular/core';
@bhalash
bhalash / capybara_authlogic.md
Last active January 17, 2019 07:13
Capybara, RSpec and AuthLogic

RSpec, Capybara and AuthLogic

This gist is dedicated to all of my fellow clueless n00bs who are frightened by the combination of [RSpec][1], [Capybara][2] and [Authlogic][3].

This gist will not tell you how to install Ruby, Rails, RSpec, Capybara or Authlogic. For the most part, you can install any of these by running either:

brew install <packagename>
bundle install <packagename>

At the point in time that you reach this gist, you should have all of them installed.

@bhalash
bhalash / Updated lightbox.js
Last active November 5, 2017 04:28
Simple Lightbox
;(function($, window, document, undefined) {
'use strict';
$.fn.addLightbox = $.fn.addLightbox || function(args) {
var defaults = {
classes: {
hasLightbox: 'has-lightbox',
lightbox: 'rmwb-lightbox'
},
imgData: {
@bhalash
bhalash / questions.md
Last active October 18, 2017 09:57
Fiendishly-Difficult Candidate Questions (Muahahahahaha)

Problem 1

Reverse all characters in a string.

'Bob Ate Fresh Gummy Karate Monkeys' => 'syeknoM etaraK ymmuG hserF etA boB'

Problem 2

Reverse only the order of words in a string.

'Bob Ate Fresh Gummy Karate Monkeys' => 'Monkeys Karate Gummy Fresh Ate Bob'

@bhalash
bhalash / yarn.config
Last active October 17, 2017 16:43 — forked from sealocal/yarn.config
Install Yarn and NodeJS on AWS Elastic Beanstalk EC2 Instance with Amazon Linux Ruby Platform, prior to precompiling assets for a Rails app
# vim: set ft=yaml:
# @see https://gist.github.com/sealocal/0cd468ba4f12cdada436aebe534b40da
---
files:
'/opt/elasticbeanstalk/hooks/appdeploy/pre/09_yarn_install.sh':
mode: '000775'
owner: root
group: users
content: |
#!/bin/bash
@bhalash
bhalash / likes.rb
Created September 6, 2017 10:37
Like/Dislike Model Example Code
# Add given object to self's liked objects.
#
# @example
#
# @user.like Post.first
# @user.public_send('liked_posts') << Post.first
# @uuse.liked_posts << Post.first
#
# @param obj [ApplicationRecord::Likeable] Any likeable record.
#!/usr/bin/env bash
#
# Sort automatically-uploaded Dropbox photographs and videos into correct
# folders after removing crud like gifs and screenshots:
#
# 1. A dated folder (e.g. 1970-01-01 for an image taken on January, 1970) for
# non-square (non-Instagram) images.
# 2. My dump folder for square Instagram images.
#
# Blame Mark (mark@bhalash.com) for this.