Skip to content

Instantly share code, notes, and snippets.

View chrisl8888's full-sized avatar
πŸ’­
🏈

Chris Lee chrisl8888

πŸ’­
🏈
View GitHub Profile
@chrisl8888
chrisl8888 / angular.dom.ready.js
Created November 3, 2015 16:29
angular dom ready
angular.element(document).ready(function () {
});
@chrisl8888
chrisl8888 / gulpfile.js
Last active October 29, 2015 00:49
Gulp open chrome in windows with arguments borrowed from - https://github.com/karma-runner/karma/issues/479
gulp.task('open', function (done) {
var uri = 'http://localhost:' + CONFIG.PORT + '/tms.html';
var spawn = require('child_process').spawn,
tempDir = 'C:/temp-chrome-eng';
var args = [
'--user-data-dir=' + tempDir,
'--no-default-browser-check',
'--no-first-run',
@chrisl8888
chrisl8888 / nested.json
Created October 27, 2015 20:51
Nested json
[
{ name: 'Europe',
children: [
{ name: 'Italy',
children: [
{ name: 'Rome' },
{ name: 'Milan' }
]},
{ name: 'Spain'}
]
@chrisl8888
chrisl8888 / chrome-location.js
Created October 25, 2015 03:18
get chrome location with nodejs - from chrome-location: https://github.com/hughsk/chrome-location/blob/master/index.js
var osx = process.platform === 'darwin'
var win = process.platform === 'win32'
var other = !osx && !win
var fs = require('fs')
if (other) {
try {
module.exports = require('which').sync('google-chrome')
} catch(e) {
module.exports = null
@chrisl8888
chrisl8888 / static-resource.vfp
Created October 23, 2015 20:57
Inject the dynamic static resource from VisualForce into your Javascript
<apex:page>
<script>console.log('{!URLFOR($Resource.TMS_Statics, '')}')</script>
</apex:page>
@chrisl8888
chrisl8888 / git-export.sh
Created October 23, 2015 16:44
example how to export your branch to a zip
git archive --format zip --output /full/path/to/zipfile.zip master
{ "directory" : "bower_components", "strict-ssl": false, "https-proxy": "" }
@chrisl8888
chrisl8888 / chrome.bat
Last active November 9, 2015 20:31
Execute so chrome will disable websecurity open with a temporary user
start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:/temp-chrome-eng" --new-window http://localhost
function encode(unencoded) {
return encodeURIComponent(unencoded).replace(/'/g,"%27").replace(/"/g,"%22");
}
function decode(encoded) {
return decodeURIComponent(encoded.replace(/\+/g, " "));
}