Skip to content

Instantly share code, notes, and snippets.

@abbotto
abbotto / dateMap.js
Last active August 29, 2015 14:25
Pass in an ISO-8601 date string and get back an object containing the date details
// Example Usage: http://codepen.io/o0110o/pen/gpdKYp
/**
* Pad
* @param {String}
* @param {String}
* @param {Integer}
* @return {String}
*/
// Borrowed from: https://github.com/o0110o/meta-js/blob/master/src/util.js
@abbotto
abbotto / app.data.js
Last active August 29, 2015 14:24
localStorage with expiry date
// Save data with expiry date
var app = {
data: ''
};
// Enhanced localStorage with expiry
app.data = {
save: function(storageKey, value, expiry) {
if (!expiry) {
expiry = "360"; // Default expiry of 6 hours
@abbotto
abbotto / antergos_change_apache_webroot
Last active October 18, 2016 17:30
Antergos - Change Apache Webroot
INSTALL:
sudo pacman --noconfirm -S apache php php-apache
RUN THIS COMMAND:
sudo nano /etc/httpd/conf/httpd.conf
EDIT THESE LINES IN THE /etc/httpd/conf/httpd.conf FILE:
- Add: LoadModule php5_module modules/libphp5.so
- Add: Include conf/extra/php5_module.conf
- Update: ServerName localhost:80
@abbotto
abbotto / ajax.history.js
Last active August 29, 2015 14:24
Use the History API with jQuery AJAX
// define asset paths
viewPath = 'view/';
clientPath = 'client/';
designPath = 'design/';
// cache some vars
$doc = $(document);
$app = $("#application");
// initial page view
@abbotto
abbotto / antergos-fix-cnchi.sh
Created June 22, 2015 23:06
Antergos LiveCD - Fix Cnchi
#!/usr/bin/env bash
# Fix Cnchi on Antergos LiveCD (2015.06.22)
sudo pacman -S git && sudo rm -rf /usr/share/cnchi && git clone https://github.com/Antergos/cnchi --depth=1 && cd cnchi && ./run
@abbotto
abbotto / gruntfile.js
Last active August 29, 2015 14:22
Grunt Config
'use strict';
module.exports = function(grunt) {
var pkg = require('./package.json');
require('load-grunt-tasks')(grunt);
grunt.initConfig({
env: {
@abbotto
abbotto / arch-amd-catalyst
Last active March 8, 2023 10:54
Install Latest AMD Catalyst Video Drivers in Arch Linux
# INSTRUCTIONS
# ==============
# IMPORTANT NOTICE:
# “catalyst-test”, from AUR, contains the “latest” AMD/ATI testing/beta drivers, primarily for newer cards.
# Please note that Radeons HD 2 3 4 xxx ARE NOT SUPPORTED
# Reference: https://aur.archlinux.org/packages/catalyst-test/
# Reference: https://wiki.archlinux.org/index.php/AMD_Catalyst
# Reference: http://www.ramblgyrl.com/2014/11/install-catalyst-drivers-on-arch-linux/
# ==============
@abbotto
abbotto / systemd-down
Last active August 29, 2015 14:21
SystemD Startup and Shutdown Scripts
# PUT HERE: /usr/lib/systemd/system/rc-local-shutdown.service
[Unit]
Description=/etc/rc.local.shutdown Compatibility
ConditionFileIsExecutable=/etc/rc.local.shutdown
DefaultDependencies=no
After=rc-local.service basic.target
Before=shutdown.target
[Service]
Type=oneshot
@abbotto
abbotto / bootstrap-antergos.sh
Last active September 7, 2015 01:41
Bootstrap for Antergos
#!/usr/bin/env bash
# Bootstrap for Antergos
# Major Updates
# (2015.09.05)
# (2015.05.19)
# Clear the package cache
sudo pacman -Scc
<b>AJAX Calls</b><hr>
<div>
<button class='toggle-text'>This is XHR</button>
</div>