Skip to content

Instantly share code, notes, and snippets.

Cody Lundquist meenie

Block or report user

Report or block meenie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:9859dcd60cb8cef1ab869a97a2075650
> Initializing…
> Building
> ▲ npm install
> ✓ Using "yarn.lock"
> ⧗ Installing 26 main dependencies…
> `ace-resolve` did not respond in a timely fashion, bailing…
> ▲ yarn
> yarn install v1.5.1
> [1/5] Validating package.json...
> [2/5] Resolving packages...
@meenie
meenie / brainfuck.ts
Last active May 21, 2019
A Brainfuck interpreter written in TypeScript
View brainfuck.ts
class Brainfuck {
ptr: number = 0
cmdPtr: number = 0
data: number[] = [0]
output: any[] = []
loops: number[] = []
input: string;
arg: string;
argPtr: number = 0;
View config.ts
import {Store} from 'confidence';
import {readFileSync} from 'fs';
const criteria = {
env: process.env.NODE_ENV || 'development'
};
let store,
config;
config = {
View config.js
System.config({
baseURL: "/",
defaultJSExtensions: true,
transpiler: "typescript",
typescriptOptions: {
"emitDecoratorMetadata": true
},
paths: {
"*": "js/*",
"js": "js",
@meenie
meenie / keybase.md
Created Mar 26, 2014
Verifying Github Account with Keybase.io
View keybase.md

Keybase proof

I hereby claim:

  • I am meenie on github.
  • I am meenie (https://keybase.io/meenie) on keybase.
  • I have a public key whose fingerprint is 83CF CA64 ED8F EA9A 51E5 C6DF CD16 4BEB F176 8774

To claim this, I am signing this object:

@meenie
meenie / gist:7078009
Created Oct 21, 2013
Proposal for modularising LESS files in your front-end MVC application using Grunt
View gist:7078009

Background

One of the industry standards that has come about since the inception of JavaScript MVC frameworks is to organise your application by feature, rather than by common files. The structure of your application follows closely to the URL structure of your application. For an example see https://github.com/ngbp/ng-boilerplate/tree/v0.3.1-release/src/app. So each feature of your application has it's own stylesheet, most likely a LESS file. You put all of the styles pertaining to that feature in there. Then you use a grunt task which collects all of the LESS files, compiles them into CSS and then concatenates them into one CSS file which is used for the whole application.

The Problem

The issue you run into is that you need to have some level of specificity so that the styles you add in that particular file do not apply to other features. Too much specificity can actually slow down the rendering engine in the browser when it interprets your styles. Not enough specificity and those styles c

View filters.js
app.filter('parseUrl', function () {
var replacements = [
{
//URLs starting with http://, https://, or ftp://
search: /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,
replace: '<a href="$1" target="_blank">$1</a>'
},
{
//URLs starting with "www." (without // before it, or it'd re-link the ones done above).
search: /(^|[^\/])(www\.[\S]+(\b|$))/gim,
@meenie
meenie / munee.php
Last active Dec 15, 2015
Munee undocumented feature - Image Placeholders
View munee.php
<?php
require 'vendor/autoload.php';
/**
* A new feature in Munee is being able to use image placeholders for missing images.
* This is a great feature to have if you are designer just starting a new site and don't necessarily have
* all of your images available. You can specify a specific image or use one of the numerous image placeholder
* websites out there like http://placedog.com.
*
* You can also specify different image paths for different placeholder images as well.
* So if you want a different image for all of your /img/category/* images and another for all of your /img/product/*
View gist:905102
/*
* Only the alert from the beforeSubmit callback is fired off.
* The reason I need to do this is so other $.ajax calls (not using the ajaxForm plugin) will also use the success callback
* I suppose if I use $(document).ajaxSuccess() it would work, but that's not the point.
* If you were to extend $.ajaxSettings on line 65 of your most recent version (2.68) it will work properly.
*/
$(function() {
$.ajaxSetup({
success: function() {
alert('Fire off Success callback for all Ajax Requests');
You can’t perform that action at this time.