Skip to content

Instantly share code, notes, and snippets.

Avatar

Fred Ngo fredngo

View GitHub Profile
@fredngo
fredngo / list.md
Created Nov 5, 2021 — forked from ih2502mk/list.md
Quantopian Lectures Saved
View list.md
@fredngo
fredngo / remove_swatches.css
Created Jun 27, 2019
Styles for Removing Swatches
View remove_swatches.css
/* The CSS below is required in order to support swatch removal. */
.swatch {
text-shadow: 0;
display: grid;
align-content: center;
grid-template-columns: auto;
}
.swatch > :last-child {
text-align: center;
align-self: center;
@fredngo
fredngo / add_swatches.css
Created Jun 27, 2019
Styles for Adding Swatches
View add_swatches.css
/* Styles for Adding Swatches */
main > section {
display: grid;
grid-template-rows: 3fr 1fr;
}
form {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-around;
@fredngo
fredngo / index.erb
Created Jan 24, 2017
Starter code for Requests and Responses lecture
View index.erb
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
</body>
</html>
@fredngo
fredngo / index.html
Created Nov 25, 2016
Starter code for Intro to Ajax lecture
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Intro to AJAX</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="ajax.js" charset="utf-8"></script>
</head>
<body>
<h1>Intro to AJAX</h1>
@fredngo
fredngo / gist:b8d0417d85a43185ba35
Created Jul 25, 2014
Cloud66 error with undefined method `auto_strip_attributes'
View gist:b8d0417d85a43185ba35
root@c66homeopathyjackal:/var/deploy/homeopathy/web_head/current# tail -59 /var/deploy/homeopathy/web_head/current/log/nginx_error.log
App 10882 stdout:
App 10882 stdout: I, [2014-07-25T21:49:35.303580 #10882] INFO -- : ** [Raven] Raven 0.9.4 ready to catch errors
App 10882 stdout:
[ 2014-07-25 21:49:36.1727 5030/7f512376b700 Pool2/Implementation.cpp:883 ]: Could not spawn process for group /var/deploy/homeopathy/web_head/current#default: An error occured while starting up the preloader.
in 'void Passenger::ApplicationPool2::SmartSpawner::handleErrorResponse(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:451)
in 'std::string Passenger::ApplicationPool2::SmartSpawner::negotiatePreloaderStartup(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:562)
in 'void Passenger::ApplicationPool2::SmartSpawner::startPreloader()' (SmartSpawner.h:202)
in 'virtual Passenger::ApplicationPool2::ProcessPtr Passenger::ApplicationPool2::SmartSpawner:
@fredngo
fredngo / gist:5468325
Created Apr 26, 2013
Bash script that outputs the number of threads used by all processes belonging to the 'vagrant' user.
View gist:5468325
while true
do
# Command line inspired from http://askubuntu.com/a/88983
ps -u vagrant -o thcount | tail -n +2 | awk '{ num_threads += $1 } END { print num_threads }'
sleep 1
done