Skip to content

Instantly share code, notes, and snippets.

View ravinggenius's full-sized avatar
🤔
likely thinking

Thomas Ingram ravinggenius

🤔
likely thinking
View GitHub Profile
## config/initializers/conf_conf.rb
# load user-specific environment files
# (env* should be added to .gitignore)
[
Rails.root + "env_#{Rails.env}.rb",
Rails.root + 'env.rb'
].each do |env_file|
require env_file if env_file.file?
end
@kyledrake
kyledrake / ferengi-plan.txt
Last active January 10, 2025 14:02
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""" SYSTEM """"""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible " DO NOT USE VI
set rtp+=~/.vim/bundle/vundle/ " SET VUNDLER PATH
call vundle#rc() " USE VUNDLER
set shell=/bin/bash " FIX RVM
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""" GITHUB BUNDLES """"""""""""""""""""""""""""""""
@peterc
peterc / methods_returning.rb
Last active October 29, 2023 03:10
Object#methods_returning - to work out which method on an object returns what we want
require 'stringio'
require 'timeout'
class Object
def methods_returning(expected, *args, &blk)
old_stdout = $>
$> = StringIO.new
methods.select do |meth|
Timeout::timeout(1) { dup.public_send(meth, *args, &blk) == expected rescue false } rescue false
@calebwoods
calebwoods / bookmarklet.js
Last active January 3, 2016 12:59
Bookmarklet to fill custom merge message for Github Pull Request. Format used by @RoleModel
javascript:(function () {
var mergeMessage = $('.merge-commit-message');
if (mergeMessage.length > 0) {
prNum = location.pathname.split('/').slice(-1)[0];
var prTitle = $('.discussion-topic-title').text();
mergeMessage.val('' + prTitle + ' [KB #NUMBER] (GH #' + prNum + ')');
}
})();
@JoelBesada
JoelBesada / README.md
Last active October 14, 2022 04:20
Backtick Example Command

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
@sporto
sporto / gist:5844051
Created June 23, 2013 06:41
Angular Nested Directives
<!doctype html>
<html ng-app='NESTED'>
<head>
<script src="components/angular/angular.js"></script>
<script src="js/app/nested.js"></script>
</head>
<body>
<div ng-controller="IndexCtrl">
<collection collection='tasks'></collection>
</div>
@shanselman
shanselman / gist:5422230
Last active April 10, 2025 15:49
Evil Blog Comment Spammer just exposed his template through some error and the whole thing showed up in my comments.
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
@zenorocha
zenorocha / multiple-3rd-party-widgets.js
Last active October 4, 2024 14:04
Loading multiple 3rd party widgets asynchronously
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);

Node.js Resources

What is node.js?

Node.js is just JavaScript running on the server side. That's it. That's all there is to it.

Express

  • Express Docs, if you want to get started and already know JavaScript this is the place to be