Skip to content

Instantly share code, notes, and snippets.

@sonnypgs
sonnypgs / _mobile-ready-web-app.html
Created March 17, 2024 19:05 — forked from hal0gen/_mobile-ready-web-app.html
iOS + Android settings for web applications
<!doctype html>
<!-- Adapted from https://gist.github.com/tfausak/2222823 -->
<html>
<head>
<title>Mobile-ready web app</title>
<!-- CONFIGURATION -->
@sonnypgs
sonnypgs / schedule.rb
Created January 29, 2022 23:14 — forked from mdesantis/schedule.rb
Schedule script for using Whenever toghether with rbenv
# Schedule script for using Whenever toghether with rbenv
#
# Whenever: https://github.com/javan/whenever
# rbenv: https://github.com/sstephenson/rbenv
set :env_path, '"$HOME/.rbenv/shims":"$HOME/.rbenv/bin"'
# doesn't need modifications
# job_type :command, ":task :output"
@sonnypgs
sonnypgs / node-folder-structure-options.md
Created February 2, 2018 21:56 — forked from lancejpollard/node-folder-structure-options.md
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
@sonnypgs
sonnypgs / extend.plist
Created January 21, 2018 22:56 — forked from juliangruber/extend.plist
Here is how to accept files dropped on an @electronjs app's icon in osx. For this to work you need to properly package the app into a `.app`, and to place the CFBundleDocumentTypes spec into it's Info.plist. Here we're using electron-packager.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>All Files</string>
<key>LSHandlerRank</key>
@sonnypgs
sonnypgs / TrueColour.md
Created December 16, 2017 11:10 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@sonnypgs
sonnypgs / ratelimit.nginxconf
Created February 20, 2017 10:06 — forked from ipmb/ratelimit.nginxconf
Nginx reverse proxy with rate limiting
upstream myapp {
server 127.0.0.1:8081;
}
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
server {
listen 443 ssl spdy;
server_name _;
@sonnypgs
sonnypgs / gist:31a45d3685442596da134bfe86f3f1cb
Created November 20, 2016 09:25 — forked from beanieboi/gist:ad526faf063181f336a2
Codeship Nginx Config for Heroku
daemon off;
# Heroku dynos have at least 4 cores.
worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>;
events {
use epoll;
accept_mutex on;
worker_connections 1024;
}
# This is an example for a rails app to share model content to facebook and twitter with a scheduler and delayed_job_active_record
# My main model is called quote.rb
# Gemfile
gem 'omniauth-twitter', '~> 1.2'
gem 'omniauth-facebook', '~> 3.0'
gem 'validates_timeliness', '~> 4.0'
gem 'twitter', '~> 5.15'
gem 'koala', '~> 2.2'