Skip to content

Instantly share code, notes, and snippets.

View acbilimoria's full-sized avatar

Alex C. Bilimoria acbilimoria

View GitHub Profile
@acbilimoria
acbilimoria / initial-server-setup.sh
Last active September 9, 2018 21:21
Initial Server Setup -- Ubuntu 16.04 Digital Ocean
# to run:
# find and replace username with your username
adduser username
usermod -aG sudo username
su - username
mkdir ~/.ssh
chmod 700 ~/.ssh
vim ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
@acbilimoria
acbilimoria / Gruntfile.js
Last active January 19, 2016 16:58
Standard Build Automation Files
module.exports = function(grunt) {
// 1. All configuration goes here
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
@acbilimoria
acbilimoria / demo.js
Created January 17, 2016 18:51
Script to call external javascript file
https://varvy.com/pagespeed/defer-loading-javascript.html
<script type="text/javascript">
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "defer.js";
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
HTML:
<!-- Soccer Testimonial -->
<div class="container-fluid">
<div class="container">
<div class="row row-eq-height" style="min-height: 350px;">
<div class="col-sm-4 testimonial-image">
<img src="wp-content/uploads/2016/01/soccer-coach-image.png" alt="" style="margin: auto; display: block; position: relative; top: 100px; height: 150px; width: 150px; border-radius: 50%;"></img>
</div>
<div class="col-sm-8 testimonial">
set t_Co=256
syntax enable
set background=dark
set ts=4
set tabstop=4
set sw=4
set et
@acbilimoria
acbilimoria / tabs.js.coffee
Last active October 6, 2015 17:17
tabbing
show_tab = () ->
if location.hash.match(/^#tab-/)
$(".nav-tabs a[href=##{location.hash.replace('#tab-', '')}]").tab('show')
return
show_tab()
$(window).on 'popstate', ->
show_tab()
@acbilimoria
acbilimoria / buy_them_things.rb
Last active October 2, 2015 21:06
Shopify Shop Circuit
#You've discovered the Shopify Store 'Shopicruit'. Since you're obsessed with lamps and wallets,
#you want to buy every single lamp and wallet variant they have to offer. By inspecting the
#Javascript calls on the store you discovered that the shop lists products at
#http://shopicruit.myshopify.com/products.json. Write a program that calculates how much all
#lamps and wallets would cost you. Attach your program (any language) and answer in the cover letter
#field below."
require 'unirest'
require 'bigdecimal'
require 'bigdecimal/util'