This file contains hidden or 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
| import express from 'express'; | |
| const app = express(); | |
| if (IS_DEV) { | |
| require('piping')(); // https://www.npmjs.com/package/piping -- live reload app - replaces nodemon | |
| } | |
| //express routes, etc. | |
| export default app; |
This file contains hidden or 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
| // * iOS zooms on form element focus. This script prevents that behavior. | |
| // * <meta name="viewport" content="width=device-width,initial-scale=1"> | |
| // If you dynamically add a maximum-scale where no default exists, | |
| // the value persists on the page even after removed from viewport.content. | |
| // So if no maximum-scale is set, adds maximum-scale=10 on blur. | |
| // If maximum-scale is set, reuses that original value. | |
| // * <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=2.0,maximum-scale=1.0"> | |
| // second maximum-scale declaration will take precedence. | |
| // * Will respect original maximum-scale, if set. | |
| // * Works with int or float scale values. |
This file contains hidden or 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
| /**************************************************************************** | |
| * Add this snippet to ~/.mongorc in order to load it to any shell initiated | |
| * Usage: | |
| * db.myCollection.findOneById("5149cdbb62d5cbb22c000024") | |
| * db.myCollection.findOneById("5149cdbb62d5cbb22c000024",{"field":1}) | |
| *****************************************************************************/ | |
| DBCollection.prototype.findOneById = function(objId ,fields, options ){ | |
| return this.findOne({"_id":ObjectId(objId)}, fields, options); | |
| } |
This file contains hidden or 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
| /* source https://www.youtube.com/watch?v=UKi1NwqKCz8 | |
| _aj7mu _r4e4p _95tat _o0442 | |
| */ | |
| var jq = document.createElement('script'); | |
| jq.src = "//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; | |
| document.getElementsByTagName('head')[0].appendChild(jq); | |
| jQuery.noConflict() |
This file contains hidden or 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
| /*************************************************************************************** | |
| * AdWords Countdown Ad Updater -- Find stale countdown ads and replace them with | |
| * Ads that are updated with new dates. | |
| * Version 1.0 | |
| * Created By: Derek Martin | |
| * DerekMartinLA.com or MixedMarketingArtist.com | |
| ****************************************************************************************/ | |
| var DESCRIPTION2_TEXT = "Sale Ends In" |
This file contains hidden or 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
| module.exports = function textLike(str) { | |
| var escaped = str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); | |
| return new RegExp(escaped, 'i'); | |
| }; |
This file contains hidden or 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
| // context | |
| var mongoose = require('mongoose'); | |
| mongoose.connect('mongodb://...'); | |
| /** | |
| * Generates Mongoose uniqueness validator | |
| * | |
| * @param string modelName | |
| * @param string field | |
| * @param boolean caseSensitive |
This file contains hidden or 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
| // Mark locations of nearby helipads | |
| { | |
| _marker = createMarkerLocal [(format ["helipad_%1", ([0, 1000] call BIS_fnc_randomInt)]), (position _x)]; | |
| _marker setMarkerShapeLocal "ICON"; | |
| _marker setMarkerTypeLocal "hd_dot"; | |
| _marker setMarkerColor "ColorRed"; | |
| } forEach (nearestObjects [player, {"Land_helipadEmpty_F"}, 250]); |
This file contains hidden or 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 | |
| # | |
| # A git hook script to find and fix trailing whitespace | |
| # in your commits. Bypass it with the --no-verify option | |
| # to git-commit | |
| # | |
| # Logic: | |
| # | |
| # The 'git stash save' fails if the tree is clean (instead of | |
| # creating an empty stash :P). So, we only 'stash' and 'pop' if |
This file contains hidden or 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
| import _ from 'lodash'; | |
| import angular from 'angular'; | |
| import 'angular-new-router'; | |
| import 'oclazyload'; | |
| function AppController ( ) { | |
| } | |
| AppController.$routeConfig = []; |