Skip to content

Instantly share code, notes, and snippets.

View mdeltito's full-sized avatar
🥨

Mike Del Tito mdeltito

🥨
View GitHub Profile
@mdeltito
mdeltito / remote-config.toml
Last active June 6, 2022 08:51
reproduction of a http provider panic
[sources.http_source]
address = "0.0.0.0:30000"
type = "http"
[sinks.http_sink]
inputs = [ "http_source" ]
type = "http"
uri = "https://example.org"
[sinks.http_sink.encoding]
### Keybase proof
I hereby claim:
* I am mdeltito on github.
* I am mdeltito (https://keybase.io/mdeltito) on keybase.
* I have a public key ASAZnmpUkkqHXvXu4szT9nLyNqQOLqzgHD-JUyVZpW8Jzwo
To claim this, I am signing this object:
@mdeltito
mdeltito / index.js
Created August 21, 2017 21:07
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
const hash = require('object-hash')
console.log(hash([{startTime: 1, endTime: 2}, {startTime: 3, endTime: 4}]));
console.log(hash([{startTime: 5, endTime: 6}, {startTime: 7, endTime: 8}]));
@mdeltito
mdeltito / README.md
Created July 14, 2016 13:45 — forked from Sinetheta/README.md
Using Yeoman to make a SharePoint 2010 project with REST.

Setting up a new Yeoman project using the sp2010 rest emulator:

  1. Create a new Yeoman project, eg: $ yo webapp my-project.
  2. Install the SharePoint 2010 rest emulator $ npm install sp2010-rest --save-dev.
  3. Add the rest emulator as middleware to any connect servers in your project's [Gruntfile.js][Gruntfile].
  4. Create a 'lists' folder in your project, and fill it with a copy of the json REST response (eg: /_vti_bin/listdata.svc/Documents -> [demo-list.json][json]) for any SharePoint lists you would like to emulate.

Deploying a Yeoman project to a sp2010 server:

  1. Map a network drive to SharePoint.
diff --git a/menu_block.admin.inc b/menu_block.admin.inc
index 992a0cc..2236d1a 100644
--- a/menu_block.admin.inc
+++ b/menu_block.admin.inc
@@ -164,6 +164,7 @@ function menu_block_delete_submit($form, &$form_state) {
variable_del("menu_block_{$delta}_level");
variable_del("menu_block_{$delta}_follow");
variable_del("menu_block_{$delta}_depth");
+ variable_del("menu_block_{$delta}_relative");
variable_del("menu_block_{$delta}_expanded");
#!/bin/bash
NODE_VERSION='0.10'
RUBY_VERSION='2.0.0-p481'
if [ ! -d ~/.nvm ]; then
echo "Installing nvm..."
git clone https://github.com/creationix/nvm.git ~/.nvm
echo -e "\n# nvm\n source ~/.nvm/nvm.sh" >> ~/.bash_profile
fi

Gem a Ruby gem is a package that contains information and files. Cucumber, and RSpec are the gems I currently have.

When I need to install a new gem, I go into my Gemfile in any text editor (Sublime, Vim, etc ;) ) and add the gem and version I want to be used. For example, the latest version of Cucumber is 1.3.16, but I've specified that I want to use 1.2.1. Then I run bundle install to ensure those versions are installed, which also updates my Gemfile.lock

gem list - I can run this command to see a list of local gems, and the versions available

After adding a new gem to my Gemfile, run the following commands:

bundle install - Install the dependencies specified in your Gemfile

@mdeltito
mdeltito / drush-fu-match.sh
Created August 1, 2014 05:07
update all features matching a pattern
drush fu | grep <pattern> | while read line; do drush fu -y "$line"; done
@mdeltito
mdeltito / httpdir.rb
Created January 9, 2014 04:06
httpdir: run a webrick webserver from any directory to serve anything.
#!/usr/bin/env ruby
require 'webrick'
require 'optparse'
include WEBrick
options = {
port: (12000 + (Dir::pwd.hash % 1000)),
dir: Dir::pwd
}
@mdeltito
mdeltito / report.module
Created December 17, 2013 21:10
adding profile2 entity form fields to a node form
<?php
/**
* implements hook_form_FORM_ID_alter
*/
function report_form_node_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'report_node_form') {
// the node author's uid is always available here
$account = user_load($form['#node']->uid);