Skip to content

Instantly share code, notes, and snippets.

@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;
// ==UserScript==
// @name Replace investors.com stylesheet with local copy
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @run-at document-start
// @match http://www.investors.com/*
// @match http://www.dev7investors.com/news*
// @grant none