Skip to content

Instantly share code, notes, and snippets.

@jimfrenette
jimfrenette / ServicesRouteMapper.cs
Last active December 11, 2015 17:59
This DotNetNuke 7 Web API ServicesRouteMapper class will give me three routes. For more info, http://jimfrenette.com/2013/01/working-with-dotnetnuke-7-services-framework-routes/
using System;
using DotNetNuke.Web.Api;
namespace DnnServices
{
public class ServicesRouteMapper : IServiceRouteMapper
{
public void RegisterRoutes(IMapRoute mapRouteManager)
{
mapRouteManager.MapHttpRoute("Services", "actionIdentity", "{controller}/{action}/{id}", new[] { "WebServices" });
@jimfrenette
jimfrenette / .editorconfig
Last active August 29, 2015 14:17
.editorconfig
# for consistent coding style across various code editors
# editorconfig.org
root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
{
"bitwise": true, // Prohibit bitwise operators (&, |, ^, etc.).
"curly": true, // Require {} for every new block or scope.
"eqeqeq": true, // Require triple equals i.e. `===`.
"es3": true, // adhere to ECMAScript 3 specification, use for Internet Explorer 6-9
"es5": true, // This option enables syntax first defined in the ECMAScript 5.1 specification.
"forin": true, // Tolerate `for in` loops without `hasOwnPrototype`.
"freeze": true, // prohibits overwriting prototypes of native objects such as Array, Date
"latedef": "nofunc", // Prohibit variable use before definition. Setting this option to "nofunc" will allow function declarations to be ignored.
"noarg": true, // Prohibits the use of arguments.caller and arguments.callee
@jimfrenette
jimfrenette / .jscsrc
Created March 22, 2015 23:26
linter configuration file for programmatically enforcing code style
{
"excludeFiles": [
".tmp/**",
".dist/**",
".docs/**",
"node_modules/**",
"vendor/**"
],
"disallowEmptyBlocks": true,
"disallowKeywordsOnNewLine": ["else"],
@jimfrenette
jimfrenette / functions.php
Last active August 29, 2015 14:24
WordPress theme twentyfifteen_scripts function modified to load page or post specific stylesheets and or scripts using custom fields. More info at http://jimfrenette.com/2015/07/wordpress-page-specific-styles-or-scripts/
/**
* This is the twentyfifteen_scripts function and its respective add_action from
* the functions.php file. This function has been modified to load page or post
* specific stylesheets and or scripts using custom fields.
* You can view the original unmodified functions.php file in svn at
* https://themes.svn.wordpress.org/twentyfifteen/1.0/functions.php
*
* Enqueue scripts and styles.
*
* @since Twenty Fifteen 1.0
@jimfrenette
jimfrenette / laravel5.2-el6-vue2-webpack-package.json
Created November 1, 2016 00:35
NPM manifest for Laravel 5.2 with Elixir 6, Vue 2 and Webpack
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"gulp": "^3.9.1",
"laravel-elixir": "^6.0.0-11",
"laravel-elixir-vue-2": "^0.2.0",
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@jimfrenette
jimfrenette / UtilityMenuExample.ps1
Last active February 19, 2017 17:26
PowerShell Script with menu and utility functions to demonstrate env: and other system variables
function ListProcess
{
Get-Process | Group-Object Company | Sort-Object Count -Descending
}
function ListEnvVars
{
Get-ChildItem env:
}
@jimfrenette
jimfrenette / docker-compose.yml
Last active March 23, 2017 02:31
two wordpress sites, nginx-proxy, mariadb, and phpmyadmin. uses official WordPress container from hub.docker.com
version: "2"
services:
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
db:
@jimfrenette
jimfrenette / Homestead.yaml
Created March 21, 2017 00:36
Sample Laravel Homestead config
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa