/**
* Validate some data.
*
* @param string|array $fields
* @param string|array $rules
* @return bool
*/
function validate($fields, $rules)
{
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :application, "App Name" # Your app name | |
set :repository, "git@github.com:xxxxx/xxx.git" # Your git repository | |
set :document_root, "/home/user/www/awesome_app" | |
set :deploy_via, :remote_cache | |
# SSH Settings | |
set :user, "user_ssh" | |
set :password, "password_ssh" | |
set :use_sudo, false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var taskQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0) | |
dispatch_async(taskQueue, { () -> Void in | |
let task = NSTask() | |
task.launchPath = "/bin/ls" | |
task.arguments = [] | |
let pipe = NSPipe() | |
task.standardOutput = pipe | |
task.launch() | |
let data = pipe.fileHandleForReading.readDataToEndOfFile() | |
var dataString = NSString(data: data, encoding: NSUTF8StringEncoding) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I got tired of uploading to /tmp then moving to the correct location, so these two convenience methods will save you a lot of time in the long run. | |
# Helper method to upload to /tmp then use sudo to move to correct location. | |
def put_sudo(data, to) | |
filename = File.basename(to) | |
to_directory = File.dirname(to) | |
put data, "/tmp/#{filename}" | |
run "#{sudo} mv /tmp/#{filename} #{to_directory}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Require local folder as Composer dependency | |
// whereas _package_ is a unique package ID to keep composer from overwriting existing config | |
// | |
// from within the project folder, run the following: | |
// composer-link /path/to/package package | |
// Then run composer require as usual. | |
composer-link() { | |
composer config repositories."$2" '{"type": "path", "url": "'$1'"}' --file composer.json | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tailwindcss = require('tailwindcss') | |
const purgecss = require('@fullhuman/postcss-purgecss') | |
const autoprefixer = require('autoprefixer') | |
const postcssImport = require('postcss-import') | |
module.exports = { | |
plugins: [ | |
postcssImport, | |
tailwindcss('./tailwind.js'), | |
purgecss({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<ruleset name="MentorMate"> | |
<description> | |
The coding standard of the MentorMate team, based on the Generic, PSR2, | |
Squiz and Zend coding standards. | |
</description> | |
<arg name="colors"/> | |
<ini name="memory_limit" value="128M"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if ($paginator->hasPages()) | |
<ul class="uk-pagination"> | |
@if ($paginator->onFirstPage()) | |
<li class="uk-disabled"><a href="#"><span uk-pagination-previous></span></a></li> | |
@else | |
<li><a href="{{ $paginator->previousPageUrl() }}"><span uk-pagination-previous></span></a></li> | |
@endif | |
{{-- Pagination Elements --}} | |
@foreach ($elements as $element) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// toggleLaunchAtStartup.swift | |
// Recents | |
// | |
// Created by Phil LaPier on 5/21/15. | |
// Copyright (c) 2015 Philip LaPier. All rights reserved. | |
// | |
// With help from: https://github.com/RamonGilabert/Prodam/blob/master/Prodam/Prodam/LaunchStarter.swift | |
import Foundation |
OlderNewer