Skip to content

Instantly share code, notes, and snippets.

View elricstorm's full-sized avatar

Joel Dezenzio elricstorm

View GitHub Profile
elricstorm / keyring.rb
Created January 29, 2022 22:21
Key ring script
View keyring.rb
Your lock key ring correction
loop do
lastLine = get
View variables.rb
var = "this is a local variable"
@var = "this is an instance variable"
@@var = "this is a class variable"
$var = "this is a global variable"
VAR = "this is a constant"
def example_one
var = "local"
p "Yes this #{var} variable can be accessed here"
View person.rb
class Person
def look_around
puts "looks around carefully."
def witness_transformation
puts "Suddenly, #{@name} transforms into a #{$gender} named #{@new_name} right before your eyes!"
elricstorm / con-remote-example2.ps1
Last active August 29, 2015 14:04
Connect to remote computer
View con-remote-example2.ps1
function con-remote {
# Look for a parameter to be sent for the computer name
# Supply a computer name parameter
$name=$(Write-Host "You must specify the computer name as an argument."),
# Supply a routine to perform like OST
if ($name -ne $null) {
if (Test-Connection -Computername $name -BufferSize 16 -Count 1 -Quiet) {
elricstorm / PowerShell-ISE.bat
Last active August 29, 2015 14:03
PowerShell Help
View PowerShell-ISE.bat
cd C:\
C:\Windows\System32\runas.exe /env /noprofile /user:corp\username "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -command \"start-process powershell_ise -verb RunAs\""
elricstorm / example.rb
Last active August 29, 2015 14:03
View example.rb
10.times do
puts "This will be printed 10 times"
View Gemfile
gem 'jquery-ui-rails'
View ajax_controller.rb
class AjaxController < ApplicationController
def ncaa_teams
if params[:search]
like= "%".concat(params[:search].concat("%"))
teams = NcaaTeam.where("name like ?", like)
teams = NcaaTeam.all
View Gemfile
gem 'kaminari' # Pagination
View application_controller.rb
# Track request logging during development
around_filter :global_request_logging
def global_request_logging "=> USERAGENT: #{request.headers['HTTP_USER_AGENT']}" "=> REQUEST_FORMAT: #{request.format}"
ensure "=> RESPONSE_STATUS: #{response.status}"