Skip to content

Instantly share code, notes, and snippets.


Fred Ngo fredngo

View GitHub Profile
fredngo /
Created Nov 5, 2021 — forked from ih2502mk/
Quantopian Lectures Saved
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 / 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 / index.erb
Created Jan 24, 2017
Starter code for Requests and Responses lecture
View index.erb
<!DOCTYPE html>
<meta charset="utf-8">
fredngo / index.html
Created Nov 25, 2016
Starter code for Intro to Ajax lecture
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Intro to AJAX</title>
<script src=""></script>
<script src="ajax.js" charset="utf-8"></script>
<h1>Intro to AJAX</h1>
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 / 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
# Command line inspired from
ps -u vagrant -o thcount | tail -n +2 | awk '{ num_threads += $1 } END { print num_threads }'
sleep 1