Skip to content

Instantly share code, notes, and snippets.

View daftspunk's full-sized avatar

daft daftspunk

View GitHub Profile
@daftspunk
daftspunk / example-plugin.js
Last active March 20, 2016 21:23
JS Plugin Boilerplate
/*
* Example plugin
*
* Data attributes:
* - data-control="example" - enables the plugin on an element
* - data-option="value" - an option with a value
*
* JavaScript API:
* $('a#someElement').myPlugin({ option: 'value' })
*
@daftspunk
daftspunk / set_memory_limit.php
Created April 1, 2014 03:05
PHP Increase memory limit (set_memory_limit)
<?php
/**
* Increase memory limit if not already
* @param $limit Amount in megabytes
*/
private function increaseMemoryLimit($limit = 512)
{
$limitBytes = $limit * 1048576;
$currentLimit = trim(ini_get('memory_limit'));
@daftspunk
daftspunk / example-class.js
Last active August 29, 2015 14:05
JS Class Boilerplate
/*
* Example class
*
* Dependences:
* - Some other plugin (filename.js)
*/
+function ($) { "use strict";
var ExampleClass = function () {
@daftspunk
daftspunk / screencast-extending
Created October 8, 2014 09:34
Extending the User plugin
WEBVTT
00:00:00.000 --> 00:00:04.748
(whooshing sound)
00:00:04.748 --> 00:00:06.300
Hello, friends
00:00:06.300 --> 00:00:08.640
Today I'm going to demonstrate how easy it is
@daftspunk
daftspunk / ConvertTwoSpacesToFour.sublime-macro
Created October 30, 2014 00:00
Convert 2 spaces to 4 spaces, Sublime Text macro
//
// Converts code indentation from 2 spaces to 4 spaces
//
// For a hotkey, add to Preferences > Key Bindings - User:
//
// { "keys": ["ctrl+alt+i"], "command": "run_macro_file", "args": {"file": "res://Packages/User/ConvertTwoSpacesToFour.sublime-macro"} }
//
[
@daftspunk
daftspunk / DynamicModel.php
Created November 7, 2014 01:23
Dynamic OctoberCMS model
<?php namespace Acme\Blog\Models;
use Model;
/**
* DynamicModel Model
*/
class DynamicModel extends Model
{
@daftspunk
daftspunk / screencast-introduction
Created December 19, 2014 03:17
Introduction to October
WEBVTT
00:00:00.000 --> 00:00:04.727
(whooshing sound)
00:00:04.727 --> 00:00:06.287
Hello
00:00:06.287 --> 00:00:09.200
and welcome to this introduction to October
Web & Software Development:
- .NET
- AJAX
- AMQP
- ASP
- ASP.NET
- Active Directory
- Adobe Air
- Agile Development
- Alibaba
# ===================================
# Workflow Definitions
# ===================================
workflow:
name: Invoice status
startStep: draft
steps:
draft:
@daftspunk
daftspunk / KatsuChicken.md
Last active November 3, 2021 02:34
Recipe: Katsu chicken with Japchae noodles

Katsu chicken with Japchae noodles

Japanese + Korean = <3

Serves: 4

Katsu Chicken

  • 4 Chicken fillets
  • 2 eggs