Skip to content

Instantly share code, notes, and snippets.

David Cheung davycheung

Block or report user

Report or block davycheung

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
@havvg
havvg / ajax-form.js
Created Aug 1, 2012
jQuery AJAX form submit with Twitter Bootstrap modal
View ajax-form.js
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@nikcub
nikcub / README.md
Created Oct 4, 2012
Facebook PHP Source Code from August 2007
View README.md
@mikaelbr
mikaelbr / gulpfile.js
Created Jan 14, 2014
Example gulpfile for complete set-up.
View gulpfile.js
var gulp = require('gulp');
var browserify = require('gulp-browserify');
var concat = require('gulp-concat');
var less = require('gulp-less');
var refresh = require('gulp-livereload');
var lr = require('tiny-lr');
var server = lr();
var minifyCSS = require('gulp-minify-css');
var embedlr = require('gulp-embedlr');
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active Oct 15, 2019
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew
View fix-homebrew-npm.md

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

View regex.md

Regular Expressions

Basic Syntax

  • /.../: Start and end regex delimiters
  • |: Alternation
  • (): Grouping
@staltz
staltz / introrx.md
Last active Oct 16, 2019
The introduction to Reactive Programming you've been missing
View introrx.md
@rap2hpoutre
rap2hpoutre / gup-to-webpack.md
Last active Sep 25, 2019
Laravel 5.4: migrate from gulp to webpack
View gup-to-webpack.md
  • Create a webpack.mix.js file in root directory:
const { mix } = require('laravel-mix');

mix.js('resources/assets/js/app.js', 'public/js')
  .sass('resources/assets/sass/app.scss', 'public/css');
  
/* Optional: uncomment for bootstrap fonts */
// mix.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/fonts/bootstrap');
@davejamesmiller
davejamesmiller / Laravel-Container.md
Last active Oct 12, 2019
Laravel's Dependency Injection Container in Depth
View Laravel-Container.md

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

You can’t perform that action at this time.