Skip to content

Instantly share code, notes, and snippets.

View slucero's full-sized avatar

Stephen Lucero slucero

  • Red Hat
  • Arkansas
View GitHub Profile
@JosephPecoraro
JosephPecoraro / shell-execution.rb
Last active September 10, 2023 10:12
Shell Execution in Ruby
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Synchronous (blocking)
# Returns the output of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
@loonies
loonies / 1_phpunit-api.md
Last active January 19, 2024 07:34
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this->anything()
@roberto
roberto / _flash_messages.html.erb
Created August 13, 2012 22:47
Rails flash messages using Twitter Bootstrap
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
@niksumeiko
niksumeiko / git.migrate
Last active July 10, 2024 14:29
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@ziadoz
ziadoz / composer_path.json
Last active January 4, 2023 19:36
Composer Using Local Repositories and Branches
{
"repositories": [
{
"type": "path",
"url": "../relative/project/path"
}
],
"require": {
"${project}": "dev-${branch}"
}
@slucero
slucero / Vagrantfile
Last active January 25, 2018 22:55
Local Vagrant Configuration
# ~/.vagrant.d/Vagrantfile
# Local configuration to use across all Vagrant machines
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb|
host = RbConfig::CONFIG['host_os']
# Force settings for allowed resources
if host =~ /darwin/
@crittermike
crittermike / import.php
Last active August 11, 2023 10:39
Importing Drupal 8 config programmatically
<?php
// Import arbitrary config from a variable.
// Assumes $data has the data you want to import for this config.
$config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html');
$config->setData($data)->save();
// Or, re-import the default config for a module or profile, etc.
\Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module');
@ntamvl
ntamvl / list-of-chrome-driver-command-line-arguments.md
Created January 30, 2019 04:20
List of Chrome Driver command line arguments

List of Chrome Driver command line arguments

Here is the list of Chrome Driver command line Arguments.

If you are using chrome Driver for Selenium WebDriver or Protractor or …. then these are a handy useful list of command line arguments that can be used.

You may use this to look at the usuage: https://code.google.com/p/chromium/codesearch#chromium/src/chromeos/chromeos_switches.cc

Run chromedriver –help to see command line arguments for your version.