Skip to content

Instantly share code, notes, and snippets.

@BriceShatzer
BriceShatzer / gist:3deee6c7e87fda1dd974
Created December 22, 2014 22:27
Shimming for the broken /deep/ selector in sass
var styleSheet = $.grep(document.styleSheets, function(styleSheet){
return /assets\/css\/main.css/.test(styleSheet.href)
})[0]
$.grep(styleSheet.cssRules, function(rule){
return /isbn-prices/.test(rule.selectorText)
}).forEach(function(ruleToAdd){
var modified_selector;
var original_selector = ruleToAdd.selectorText;
var style = ruleToAdd.style.cssText;

#Angular & SEO It's probably not that big of a deal, but if it is something we want to specifically deal with, the best solution would be to serve a static page (which Laravel is currently creating already creating) anytime a search engine asks in order to prevent an angular rendered page from being shown which has the potential to not be rendered properly/at all.


##Possible ways of pointing to static pages:

###HTML5 routing mode & use nginx to proxy URLS

@BriceShatzer
BriceShatzer / gist:7f789cd31a6110b64eac
Created May 4, 2015 19:03
angular-credit-cards issue
Possible issue within https://github.com/bendrucker/angular-credit-cards
Credit Card pattern regex is too inclusive
This allows
changing to [0-9\s\-]
still allows for spaces and dashes(something that is implied to be allowed by the docs) but prevents other characters.
Currently, all characters are allowed as long as they fall in amongst a valid card number.
Device 'AlpsPS/2 ALPS DualPoint TouchPad':
Device Enabled (135): 1
Coordinate Transformation Matrix (137): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (258): 1
Device Accel Constant Deceleration (259): 2.500000
Device Accel Adaptive Deceleration (260): 1.000000
Device Accel Velocity Scaling (261): 12.500000
Synaptics Edges (281): 300, 1700, 210, 1190
Synaptics Finger (282): 12, 15, 0
Synaptics Tap Time (283): 180
@BriceShatzer
BriceShatzer / instructions.md
Last active August 29, 2015 14:26
Getting projects running locally w/ apache & webmin
  1. clone repo
  2. composer install / npm|bower install -> grunt|grunt
  3. edit /etc/hosts -> add new domain
  4. update webmin (http://localhost:10000/)
  5. apache webserver -> create new virtual host
  6. edit directives -> copy/add:
AllowOverride all
allow from all
Options -Indexes +FollowSymLinks
"font_face": "Consolas",
"font_size": 13,
---
"font_face": "Monospace Regular",
"font_size": 12,
---
"font_face": "Droid Sans Mono",
"font_size": 12/13,
---
"font_face": "FreeSans Mono",
var finalhandler = require('finalhandler');
var http = require('http');
var serveStatic = require('serve-static');
var request = require('request');
var fs = require('fs');
var serve = serveStatic('public');
request('http://api.dronestre.am/data').pipe(fs.createWriteStream('public/data.json'));
//request.get('http://api.dronestre.am/data').pipe(request.put('localhost:8080/livedata.json'));
  • Packback-Common
  • Engineering Docs
    • ✔️merge sass & foundation mixins into a single page
    • include updated kitchen sink and explore a better way of integrating it with the repo
    • ✔️document current import strategy/structure for using packback-common in a project
  • Packback Wiki
  • setup some sort of content backup
@BriceShatzer
BriceShatzer / example.js
Last active September 29, 2015 16:58
Basic AJAX Request
var response;
function makeRequest (url) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
response = xmlhttp.responseText;
}
}

#Getting all media queries present in a stylesheet

Note: Access to the cssRules attribute is subject to the cross-origin policy
Some thoughts on getting around that issue here

var mediaQueriesMap = new Map();

var rules;