Skip to content

Instantly share code, notes, and snippets.

View jittdev's full-sized avatar

Subrosa Games LLC jittdev

View GitHub Profile
@jittdev
jittdev / ForkingAProcess1.bat
Created March 14, 2023 13:57
forking a process :: #api - ruby backend
The Ruby system method is the simplest way to run an external command.
https://stackoverflow.com/questions/307070/how-do-you-spawn-a-child-process-in-ruby
system("ls")
Notice that system will print the command output as it happens.
Also system will make your Ruby program wait until the command is done.
@jittdev
jittdev / Routes.RbApiNamespace1.rb
Created March 14, 2023 13:57
routes.rb api namespace :: #Ruby / Rails
namespace :api do
namespace :v1 do
end
end
@jittdev
jittdev / FileChangesNeededAfterGitPull1.rb
Created March 14, 2023 13:57
File Changes needed after Git pull :: #VS
# in database.yml change socket to below value and might need to change pool
default: &default
adapter: mysql2
encoding: utf8
pool: 5
min_messages: warning
timeout: 5000
username: root
password: root
socket: /var/run/mysqld/mysqld.sock
@jittdev
jittdev / MysqlWon'TStartWithMamp1.txt
Created March 14, 2023 13:57
MySQL won't start with MAMP :: #error fixing
Quit MAMP.
In the finder go to Applications/MAMP/db/mysql/ and delete the last log file (look for a file named ib_logfileN – being N the log number). Please back up these before you delete them 🙂
Restart MAMP.
Also, can type:
killall -9 mysqld
in terminal to make sure multiple instances are not running.
@jittdev
jittdev / ListComprehensions1.py
Created March 14, 2023 13:57
list comprehensions :: #Python Advanced
# list comprehension
my_list = [param for param in 'hello']
my_list2 = [num for num in range(0,100)]
print(my_list2)
my_list3 = [num*2 for num in range(0,100)]
print(my_list3)
my_list4 = [num**2 for num in range(0,100) if num %2 ==0]
print(my_list4)
@jittdev
jittdev / Colors-All1.txt
Created March 14, 2023 13:57
Colors - ALL
colorhexa.com
@jittdev
jittdev / WhehPhp.IniNotUpdatingWordpressSettings...1.txt
Created March 14, 2023 13:57
Wheh php.ini not updating wordpress settings... :: #Wordpress
this is because you are using php-fpm.
so, after changing /etc/php.ini, you need to run
systemctl restart httpd
systemctl restart php-fpm
you can also create a file in your website.com directory called phpinfo.php and add the following code in it:
<?php phpinfo(); ?>
this will show you what ini & path you're using.
@jittdev
jittdev / UsingLink_To1.Erb
Created March 14, 2023 13:57
Using link_to :: #Ruby / Rails
@jittdev
jittdev / EscapeSequences1.py
Created March 14, 2023 13:57
Escape Sequences :: #Python Basics
weather = "It\'s \"kind of\" sunny \t tabbed \n new line"
print(weather)
# => It's "kind of" sunny tabbed
# => new line
@jittdev
jittdev / GitupAfterClone(OnlyHaveToCloneOnce)1.txt
Created March 14, 2023 13:57
gitup after clone (only have to clone once) :: #git
./gitup.sh
./fixsite.rb
touch tmp/restart.txt