This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Include this file instead of importing the CSS file from deps/ | |
*/ | |
/* Top level container for live phone components. */ | |
.live_phone { | |
@apply relative flex rounded-[5px] border-[1px] border-solid border-[#ddd] bg-white; | |
@apply focus-within:shadow-[0_0_5px_blue]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Mix.Tasks.ConvertToVerifiedRoutes do | |
@shortdoc "Fix routes" | |
use Mix.Task | |
@regex ~r/(Routes\.)(.*)_(path|url)\(.*?\)/ | |
@web_module MyAppWeb | |
def run(_) do | |
Path.wildcard("lib/**/*.*ex") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "forwarded_port", guest: 80, host: 8080 | |
config.vm.provider "virtualbox" do |vb| | |
vb.memory = 1024 | |
vb.cpus = 2 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setInterval(function () { | |
console.log('A second has passed. Time to get to work.'); | |
}, 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var shortlistings = (function() { | |
"use strict"; | |
var exports = { | |
disableSession: disableSession, | |
enableSession: enableSession, | |
set: set | |
}, | |
session_storage_method = window.sessionStorage, | |
local_storage_method = window.localStorage, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
end_branch=$1 | |
# Get currently active branch | |
active_branch=$(g branch | ack '\* ([A-Za-z0-9]+)' | cut -d' ' -f 2) | |
# Stash current changes for rebase pull | |
stash_result=$(git stash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_menu_alter(). | |
*/ | |
function module_menu_alter(&$items) { | |
$old_callback = $items['node/%node']['access callback']; | |
$old_args = $items['node/%node']['access arguments']; | |
// Overrides the access callback to remove access to note content | |
$items['node/%node']['access callback'] = '_note_node_view_access'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var baseUrl = function(){ | |
// Calculate base url by filtering on the parts | |
var parts = location.pathname.split('/'), | |
base = '', | |
i, | |
max; | |
for (i = 0, max = parts.length; i < max; i++) { | |
if(parts[i] === 'admin'){ | |
break; | |
} else if(parts[i] === ''){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// As seen in Bulletproof Ajax (The warrior, not the faulty abbreviation), by Jeremy Keith | |
var httpObject = function(){ | |
if(window.XMLHttpRequest){ | |
httpObject = function(){ | |
return new XMLHttpRequest(); | |
}; | |
} else if(window.ActiveXObject) { | |
var xhr; | |
try{ | |
xhr = new ActiveXObject("Msxml2.XMLHTTP"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IncExtFilterIterator extends FilterIterator | |
{ | |
protected $_extensions; | |
public function __construct($path, $includeExt) | |
{ | |
parent::__construct(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path))); | |
$this->_extensions = $includeExt; |