Skip to content

Instantly share code, notes, and snippets.

View mandelbro's full-sized avatar
🌀

Chris Montes mandelbro

🌀
View GitHub Profile
@mandelbro
mandelbro / zepto-jquery-wrapper.js
Last active August 29, 2015 13:56
Zepto/jQuery Wrapper
/**
* A simple JavaScript wrapper that will provide allow
* you to take advantage of the ZeptoJS library if it
* is available, and fallback to jQuery if not.
*
* Based on this pattern explanation from Stack Overflow:
* http://stackoverflow.com/a/502068
*/
;(function( $, window, undefined ) {
@mandelbro
mandelbro / drush-cheatsheet.txt
Created April 11, 2014 18:31
SPT Drush Cheatsheet
Get files from the dev server
sudo -E rsync --recursive --compress --times --rsh='ssh -l deploy' \
spt-stage.com:/var/www/deploy/current/sites/de.animax/files/ \
/var/www/deploy/current/sites/de.animax/files/ && chown -R vagrant:www-data /var/www/deploy/current/sites/de.animax/files && sudo chmod -R 777 /var/www/deploy/current/sites/de.animax/files && find /var/www/deploy/current/sites/de.animax/files -type d -exec sudo chmod 777 -R {} \;
All database commands
drush @de.animax sql-drop -y && drush cc drush && ssh -l chrismontes spt-stage.com drush @de.animax sql-dump | drush @de.animax sql-cli && drush @de.animax updb -y && drush @de.animax ucrt root --mail="[email protected]" --password="rewt" && drush @de.animax urol "super administrator" --name=root && drush @de.animax vset preprocess_css 0 --yes && drush @de.animax vset preprocess_js 0 --yes && drush @de.animax vset block_cache 0 --yes && drush @de.animax vset cache 0 --yes && drush @de.animax vset cache_content_flush_cache_block 0 --yes && drus
app.directive("scrollToOnLoad", [
'$location',
function( $location ) {
return {
restrict: "A",
link: function(scope, element, attributes) {
var scrollTo = $location.hash() === attributes.id;
// scroll to the top of the posting with a padding for the header
if(scrollTo) {
@mandelbro
mandelbro / IIFE
Last active August 31, 2016 17:46
;(function () {
"use strict";
// code in here keeps the global scope clean!
var globalVar = "I'm a global variable!";
function privateFunction () {
return "I'm a private function!";
}
;(function ( app ) {
'use strict';
angular.module('PeachDelivery')
.factory("DeployService", DeployService);
DeployService.$inject = [];
function DeployService () {
require: rubocop-rspec
AllCops:
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
TargetRubyVersion: 2.7
Exclude:
- '**/node_modules/**/*'
- '**/vendor/**/*'
Act as a highly skilled, proactive, autonomous, and meticulous senior colleague/architect. Take full ownership of tasks, operating as an extension of my thinking with extreme diligence and foresight. Your primary objective is to deliver polished, thoroughly vetted, optimally designed, and well-reasoned results with minimal interaction required. Leverage tools extensively for context gathering, deep research, ambiguity resolution, verification, and execution. Assume responsibility for understanding the full context, implications, and optimal implementation strategy. Independently resolve ambiguities and determine implementation details using tools whenever feasible.
Grasp the Core Goal: Start by deeply understanding the intent and desired outcome, looking beyond the literal request.
Pinpoint & Verify Locations: Use tools (list_dir, file_search, grep_search, codebase_search) to precisely identify and confirm all relevant files, modules, functions, configurations, or infrastructure components. Map out the rele