This file contains hidden or 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
| class Phone < ApplicationRecord | |
| belongs_to :person | |
| def self.[](index) | |
| find(index) | |
| end | |
| end |
This file contains hidden or 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
| The resource http://localhost:3000/assets/es-module-shims.min-4ca....js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally. | |
| config.action_view.preload_links_header = false | |
| This :#<NameError: uninitialized constant Gem::Source led me to this which worked for me: | |
| https://github.com/rubygems/rubygems/issues/5351#issuecomment-1216741599 | |
| Not enough Rubies in rbenv: | |
| mkdir -p "$(rbenv root)"/plugins | |
| git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| IFS='' | |
| for i in $@ | |
| do | |
| ffmpeg -i "${i}" -b:a 320k "${i%%.*}".mp3 | |
| done |
This file contains hidden or 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
| #! /bin/bash | |
| rm -rf advisorandstudent | |
| rails new advisorandstudent --skip-spring | |
| cd advisorandstudent | |
| echo "gem 'faker'" >> Gemfile | |
| bundle install | |
| rails generate scaffold Student name:string advisor:references | |
| rails generate scaffold Advisor name:string | |
| rails db:migrate |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <assert.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| /* Write a string */ | |
| #define WRITES(a) { assert (write (STDOUT_FILENO, a, strlen (a)) >= 0); } | |
| /* Write an integer i no longer than l */ | |
| #define WRITEI(i,l) { char buf[l]; assert (eye2eh (i, buf, l, 10) != -1); WRITES (buf); } | |
| /* Write a newline */ |
This file contains hidden or 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
| #! /bin/bash | |
| # my subaru plays tracks based on creation or modification date (i'm not | |
| # sure which and i'm not going to spend the time to find out), not | |
| # alphabetically nor by paying attention to the track numbers. so i wrote | |
| # this to align the dates with the alphabetic order. | |
| today=`date "+%C%y%m%d"` | |
| hour=0 | |
| minute=0 |
This file contains hidden or 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
| #! /bin/bash | |
| dryrun=false | |
| if [[ $1 == '-n' ]] | |
| then | |
| dryrun=true | |
| shift | |
| fi | |
| # 's/^([0-9])-/0\1-/' -- add one leading zero |
This file contains hidden or 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
| #! /bin/bash | |
| # remove kernel and kernel headers, leaving the three most recent versions. | |
| # the user is prompted before actions performed. | |
| # parameters: what to remove and how many to leave | |
| function doit { | |
| LIST=`dpkg -l "$1" | \ | |
| grep ii | \ | |
| grep generic | \ |
This file contains hidden or 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
| diff --git a/startwine b/startwine | |
| index 8b52866..596545a 100755 | |
| --- a/startwine | |
| +++ b/startwine | |
| @@ -1,13 +1,12 @@ | |
| #!/bin/bash | |
| - | |
| - | |
| BUNDLERESOURCEPATH="$(dirname "$0")/../Resources" |
This file contains hidden or 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
| #! /bin/bash | |
| # based partially on: | |
| # https://github.com/docker/toolbox/blob/master/osx/uninstall.sh | |
| # just an initial guess, you might want to add more. | |
| keepdirs=('/usr' '/usr/local' '/usr/local/bin' '/usr/sbin' '/etc' \ | |
| '/usr/local/etc' '/usr/local/share' ) | |
| for pkg in "$*" |
NewerOlder