Skip to content

Instantly share code, notes, and snippets.

View taktran's full-sized avatar

Tak Tran taktran

View GitHub Profile
@taktran
taktran / log.js
Created February 8, 2014 16:53
Wrap log function
// Also see http://www.paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
var log = function() {
if (console) {
console.log.apply(this, arguments);
}
}
@taktran
taktran / angularjs-di-spec.js
Last active August 29, 2015 14:05
An example of how to do dependency injection in angularjs specs
describe('currentEnvService', function() {
var currentEnvService;
var setupMocks;
var location = {};
var hostNamesMock = {};
beforeEach(angular.mock.module('app'));
beforeEach(function() {
@taktran
taktran / timeout-resolve.js
Created September 3, 2014 16:00
AngularJS resolve with a timeout
{
resolve: {
/**
* Resolve salesforce connection before loading search
*/
salesforceConnect: function(
$q,
CONFIG,
salesforceService
) {
@taktran
taktran / gist:9a265ed9f184f76aba4b
Last active August 29, 2015 14:06
Shrimping it
@taktran
taktran / wlanIP.sh
Created March 24, 2015 14:04
Get wlan0 ip address on a Raspberry Pi
ifconfig wlan0 | grep 'inet addr' | awk '{print $2}' | awk -F: '{print $2}'
@taktran
taktran / gulpfile.js
Created April 12, 2015 14:29
Gulp task to run tests on CircleCI
/**
* CI test task.
*
* Use `minijasminenode2` instead of `gulp-jasmine`
* because normal `gulp-jasmine` doesn't exit properly
* properly.
*/
gulp.task('test:ci', function() {
jasmine = require('minijasminenode2');
@taktran
taktran / gist:2d4bc56d66cf9c85eda4
Created April 12, 2015 15:41
Where MACs store bluetooth addresses (BDADDR)
/Library/Preferences/com.apple.Bluetooth.plist
@taktran
taktran / gist:2617b45365c849aa89fb
Created April 26, 2015 10:41
applyParamsToArgCallback [NOT WORKING]
"use strict";
var _ = require('lodash');
var utils = {};
/**
* Apply the rest of the arguments to the last
* item in function arguments (the callback)
*
* ```
"use strict";
function CustomCode(Button0) {
if (Button0) {
var startTime = 0;
var getReadyTime = 500;
var goTime = 1500;
var endTime = 2500;
this.sendTo('RGBLED0', [50,0,0], startTime);
ie annoyances
- use list-style: none outside; for lists to prevent using text-index: -16px
- All style tags after the first 30 style tags on an HTML page are not applied in Internet Explorer
- list style background images disappear when you scroll 
- Use
table {