Skip to content

Instantly share code, notes, and snippets.

View jwalton512's full-sized avatar

Jason Walton jwalton512

View GitHub Profile
@reinink
reinink / validation_macros.php
Created March 1, 2017 20:11
Laravel request validation macros
<?php
Request::macro('validate', function ($rules, $messages = [], $customAttributes = []) {
$this->lastValidated = array_keys($rules);
(new class() {
use ValidatesRequests;
})->validate($this, $rules, $messages, $customAttributes);
});
@mivade
mivade / cli.py
Last active January 18, 2024 07:51
Using a decorator to simplify subcommand creation with argparse
"""This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@kaishin-r
kaishin-r / sublime-text-3-cloud-drive-sync
Created February 19, 2016 09:48
Sync Sublime Text 3 Settings via iCloud Drive
# Create a directory named "Sublime Text 3 Sync" under iCloud Drive
mkdir ~/Library/Mobile\ Documents/com~apple~CloudDocs/SubLime\ Text\ 3\ Sync
# Enter Sublime Text 3's directory
cd ~/Library/Application\ Support/Sublime\ Text\ 3/
# Move "Installed Packages" directory to iCloud Drive and make a link
mv Installed\ Packages/ ~/Library/Mobile\ Documents/com~apple~CloudDocs/SubLime\ Text\ 3\ Sync/
ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/SubLime\ Text\ 3\ Sync/Installed\ Packages
define(function(require) {
var _ = require('lodash');
var app = require('app');
var enums = require('utils/enums');
var auth = require('services/auth');
var router = require('services/router');
var getAccount = require('flux/getters/account');
return {
@ericlbarnes
ericlbarnes / bower.json
Last active January 8, 2024 01:52
Gulp, Bower, Bootstrap Sass, FontAwesome
{
"name": "project",
"version": "0.0.0",
"authors": [
"Eric Barnes <me@example.org>"
],
"license": "MIT",
"private": true,
"ignore": [
"**/.*",
@JeffreyWay
JeffreyWay / .vimrc
Last active January 22, 2024 11:42
My .vimrc file
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@AndrewRadev
AndrewRadev / tohtml
Last active August 13, 2016 13:57
Use Vim's :TOhtml to make the core of a syntax highlighter.
#! /usr/bin/env ruby
require 'tempfile'
require 'vimrunner'
require 'nokogiri'
require 'json'
if ARGV.count < 2
puts "USAGE: tohtml <colorscheme-file> <filename> [filenames ...]"
exit 1
@everzet
everzet / phpspec_a3.php
Created November 1, 2012 14:19
Per-specification custom matchers support in phpspec2 alpha3
<?php
namespace spec\Bank\Controller;
use PHPSpec2\ObjectBehavior;
use PHPSpec2\Matcher\CustomMatchersProviderInterface;
use PHPSpec2\Matcher\InlineMatcher;
class PaymentController extends ObjectBehavior implements CustomMatchersProviderInterface
{
@sos4nt
sos4nt / xterm-256color-italic.terminfo
Created July 27, 2012 12:13
A xterm-256color based TERMINFO that adds the escape sequences for italic
# A xterm-256color based TERMINFO that adds the escape sequences for italic.
#
# Install:
#
# tic xterm-256color-italic.terminfo
#
# Usage:
#
# export TERM=xterm-256color-italic
#
@ricardobeat
ricardobeat / favicon.txt
Created June 4, 2012 20:36
Create multiple-size, alpha transparent favicon.ico
# How to create a favicon with multiple image sizes and keep alpha transparency
- export your images in the desired sizes (16x16, 32x32 ... max 256x256) as PNGs + alpha
- install ImageMagick
Run this command (replacing the .png files for your own images):
convert favicon-16.png favicon-32.png favicon-64.png -colors 256 -alpha background favicon.ico