Skip to content

Instantly share code, notes, and snippets.

View ai7ch's full-sized avatar
💭
I may be slow to respond.

ai7ch ai7ch

💭
I may be slow to respond.
View GitHub Profile
@ai7ch
ai7ch / gist:42148552ac23155267fba320d9c741d2
Created November 19, 2018 16:46
r.js sample configurations
/*
* This is an example build file that demonstrates how to use the build system for
* require.js.
*
* THIS BUILD FILE WILL NOT WORK. It is referencing paths that probably
* do not exist on your machine. Just use it as a guide.
*
*
* SOURCE: https://github.com/requirejs/r.js/blob/master/build/example.build.js
*
@ai7ch
ai7ch / blog-webpack-2.md
Created November 12, 2018 17:06 — forked from xjamundx/blog-webpack-2.md
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@ai7ch
ai7ch / webdev_online_resources.md
Created September 28, 2018 16:49 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@ai7ch
ai7ch / csv_to_array.php
Created July 27, 2018 14:47 — forked from jaywilliams/csv_to_array.php
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
@ai7ch
ai7ch / ssh.txt
Created July 9, 2018 11:43 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets
# Login via SSH with password (LOCAL SERVER)
> ssh brad@192.168.1.29
# Create folder, file, install Apache (Just messing around)
mkdir test
cd test
touch hello.txt
sudo apt-get install apache2
# Generate Keys
@ai7ch
ai7ch / gist:550a17306db4274b4c60441ba09f73a3
Created March 28, 2018 11:03 — forked from snowman-repos/gist:3825198
JavaScript: Detect Orientation Change on Mobile Devices
// Listen for orientation changes
window.addEventListener("orientationchange", function() {
// Announce the new orientation number
alert(window.orientation);
}, false);
// Listen for resize changes
window.addEventListener("resize", function() {
// Get screen size (inner/outerWidth, inner/outerHeight)
@ai7ch
ai7ch / require_all_helper.php
Created March 15, 2018 08:25 — forked from pwenzel/require_all_helper.php
Recursively include all PHP files
<?php
/**
* Scan the api path, recursively including all PHP files
*
* @param string $dir
* @param int $depth (optional)
*/
protected function _require_all($dir, $depth=0) {
if ($depth > $this->max_scan_depth) {