This file contains 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
<?php namespace App\Http\Controllers; | |
/* * ** | |
* | |
* MySQL database script for full schema migrations in Laravel 5. | |
* | |
* 1. Place this file inside app/Http/controllers/ | |
* | |
* 2. In this file, edit the index() method to customize this script to your needs. | |
* - inside $migrate->ignore(), you pass in an array of table |
This file contains 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 | |
# Check if the CSL app is running | |
pid=$(ps -ax | grep -m1 'Cities_Skylines/Cities.app' | grep -v grep | awk '{print $1}') | |
if [[ $pid ]] | |
then | |
echo "Cities is running under pid: $pid" | |
echo "Quitting Cities.." | |
osascript -e 'quit app "Cities"' | |
sleep 4 |
This file contains 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
on open (theList) | |
-- I found these extensions for video files here | |
-- we can check the file extensions of a file against this list to evaluate if it's a video file | |
set video_ext_list to {"3g2", "3gp", "3gp2", "3gpp", "3mm", "60d", "aep", "ajp", "amv", "asf", "asx", "avb", "avi", "avs", "bik", "bix", "box", "byu", "cvc", "dce", "dif", "dir", "divx", "dv", "dvr-ms", "dxr", "eye", "fcp", "flc", "fli", "flv", "flx", "gl", "grasp", "gvi", "gvp", "ifo", "imovieproject", "ivf", "ivs", "izz", "izzy", "lsf", "lsx", "m1v", "m2v", "m4e", "m4u", "m4v", "mjp", "mkv", "moov", "mov", "movie", "mp4", "mpe", "mpeg", "mpg", "mpv2", "msh", "mswmm", "mvb", "mvc", "nvc", "ogm", "omf", "prproj", "prx", "qt", "qtch", "rm", "rmvb", "rp", "rts", "sbk", "scm", "smil", "smv", "spl", "srt", "ssm", "svi", "swf", "swi", "tivo", "ts", "vdo", "vf", "vfw", "vid", "viewlet", "viv", "vivo", "vob", "vro", "wm", "wmd", "wmv", "wmx", "wvx", "yuv"} | |
-- notice the use of "entire contents" to also go through subfolders of f | |
-- use a "whose" f |
This file contains 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 | |
# history_of_file | |
# | |
# Outputs the full history of a given file as a sequence of | |
# logentry/diff pairs. The first revision of the file is emitted as | |
# full text since there's not previous version to compare it to. | |
function history_of_file() { | |
url=$1 # current url of file |
This file contains 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
var ip = (function() { | |
var _privateIps = [ | |
'10.0.0.0', | |
'10.255.255.255', | |
'172.16.0.0', | |
'172.31.255.255', | |
'192.168.0.0', | |
'192.168.255.255' | |
]; |
This file contains 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
ALTER SEQUENCE <tableName>_<id>_seq RESTART WITH 1 |
This file contains 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
SELECT nspname || '.' || relname AS "relation", | |
pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size" | |
FROM pg_class C | |
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) | |
WHERE nspname NOT IN ('pg_catalog', 'information_schema') | |
AND C.relkind <> 'i' | |
AND nspname !~ '^pg_toast' | |
ORDER BY pg_total_relation_size(C.oid) DESC | |
LIMIT 20; |
This file contains 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
function git_branch() { | |
git_branch=$(git branch --no-color 2>/dev/null | grep \* | sed 's/* //') | |
if [ $git_branch ] | |
then | |
white="\001\033[0;37m\002" | |
yellow="\001\033[0;33m\002" | |
blue="\001\033[0;34m\002" | |
red="\001\033[0;31m\002" | |
green="\001\033[0;32m\002" |
This file contains 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
defmodule Ellow.Zones.BFS do | |
def zone_map(name, parent \\ nil) do | |
%{ | |
name: name, | |
distance: 0, | |
parent: nil | |
} | |
end |
This file contains 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
# | |
# I have successfully run this with Anaconda on Windows directly & on WSL2/Ubuntu 22.04 with MiniConda | |
# | |
# Make sure you have Anaconda installed | |
# This tutorial assumes you have an Nvidia GPU, but you can find the non-GPU version on the Textgen WebUI github | |
# More information found here: https://github.com/oobabooga/text-generation-webui | |
# Make sure you have the CUDA 11.8 & cuDNN 11.x installed | |
# CUDA Toolkit 11.8: https://developer.nvidia.com/cuda-18-7-0-download-archive |
OlderNewer