Skip to content

Instantly share code, notes, and snippets.

// test/fancy_test_context.dart
library fancy_test_context;
import 'dart:html';
import 'package:angular/angular.dart';
import 'package:angular/mock/module.dart';
/**
* Global test context.
*/
@mattmccray
mattmccray / Cakefile
Created October 20, 2010 19:42
CoffeeScript and LESS build tool
#
# Web App Bundler Util v1.2
# by M@ McCray
# url http://gist.github.com/637154
#
# I built this for how I like to work, so YMMV.
#
# This script defines one task: 'build'. It will assemble multiple .coffee (or .less)
# files and compile them into a single .js (or .css) file. There are two main ways
# you can use it. Define the target and list all the source files to assemble into
@aseemk
aseemk / url.coffee
Created April 27, 2012 05:51
Simplified wrapper around Node's native 'url' module
# url.coffee
# by Aseem Kishore ( https://github.com/aseemk ), under MIT license
#
# A simplified wrapper around the native 'url' module that returns "live"
# objects: updates to properties are reflected in related properties. E.g.
# updates to the `port` property will be reflected on the `host` property.
#
# The public API and behavior are pretty close to the native 'url' module's:
# http://nodejs.org/docs/latest/api/url.html Currently lacking / known issues:
#
@vadimtsushko
vadimtsushko / index.html
Last active February 23, 2016 16:22
How to read properties from opaque dynamic javascript map
<!DOCTYPE html>
<!--
Copyright (c) 2016, <your name>. All rights reserved. Use of this source code
is governed by a BSD-style license that can be found in the LICENSE file.
-->
<html>
<head>
<meta charset="utf-8">
@mattmccray
mattmccray / backbone_helper.coffee
Created October 14, 2010 08:44
Use Backbone.js classes as native CoffeeScript classes
# Backbone CoffeeScript Helpers by M@ McCray.
# Source: http://gist.github.com/625893
#
# Use Backbone classes as native CoffeeScript classes:
#
# class TaskController extends Events
#
# class TaskView extends View
# tagName: 'li'
# @SRC: '<div class="icon">!</div><div class="name"><%= name %></div>'
@gmergoil
gmergoil / MySqlConnector.php
Created June 2, 2013 09:08
A revised version of the Illuminate\Database\Connectors\MySqlConnector of the Laravel 4 framework. It fixes a bug when using the unix_socket option in the database configuration.
<?php namespace Illuminate\Database\Connectors;
class MySqlConnector extends Connector implements ConnectorInterface {
/**
* Establish a database connection.
*
* @param array $options
* @return PDO
*/
@dj1020
dj1020 / migrate.sh
Last active February 5, 2019 13:05 — forked from tobi-pb/migrate.sh
Upgrade MAMP to Mysql 5.7 tested by Ken Lin 2015/11/09
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.9-osx10.10-x86_64.tar.gz
tar xfvz mysql-5.7*
echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "creating backup"
@anlutro
anlutro / install.bash
Last active May 7, 2019 05:07
Simple Laravel 4 deployment using git hooks and shell scripts
#!/usr/bin/env bash
set -e
# function to easily determine if a set of programs and files are available.
function deploy_programs_available {
local programs=(npm bower grunt)
local files=(package.json bower.json Gruntfile.js)
for p in ${programs[@]}; do
@m4grio
m4grio / Blueprint.php
Last active June 14, 2019 06:45
Extending Laravel 5 Blueprint for MySqlConnection
<?php
namespace App\Database\Schema;
use Illuminate\Database\Schema\Blueprint as ParentBlueprint;
use Illuminate\Support\Facades\DB;
/**
* Class Blueprint
*
@andy-berry-dev
andy-berry-dev / AbstractModel.php
Last active July 9, 2019 18:52
Changes required to Laravel to allow observing attached/detached events (https://github.com/laravel/framework/pull/14988#issuecomment-267717423)
<?php
use App\Extensions\Relations\BelongsToMany;
abstract class AbstractModel extends Model
{
/*
* This is copied AS IS from \Illuminate\Database\Eloquent\Model@belongsToMany but instead uses our own BelongsToMany class
*/