Skip to content

Instantly share code, notes, and snippets.

View unicornrainbow's full-sized avatar
💖
🎈Sharing codes 🔫🛍🛁📐🎉💉🕳🚬💎💰💳

Rashiki Grace unicornrainbow

💖
🎈Sharing codes 🔫🛍🛁📐🎉💉🕳🚬💎💰💳
  • Newstime
  • Daytona Beach, FL
View GitHub Profile
@unicornrainbow
unicornrainbow / Color4FaceeBoOK.user.js
Created August 6, 2021 02:26
See things in color, greasemonkey script, works life butter.
// ==UserScript==
// @name Color 4 FaceBoOK 🤩
// @version 1
// @match https://www.facebook.com/*
// @require https://unpkg.com/jquery@3.6.0/dist/jquery.js
// @require https://unpkg.com/jquery.initialize@1.3.0/jquery.initialize.js
// @grant none
// ==/UserScript==
@unicornrainbow
unicornrainbow / 💫😇😍
Created July 21, 2021 01:35
githUb piNk bikiNi sTiLiSh
body {
--candy-pink: #e81ced;
--comments: #ff9cec;
--link-color: #ff25f5;
background-color: aquamarine;
}
a {
color: #ff25f5;
}
@unicornrainbow
unicornrainbow / color4tweet.user.js
Last active December 20, 2021 10:33
Colorize Your Twitter Stream 🎈 Colorize The World. 🎊
// ==UserScript==
// @name Color 4 Tweet
// @version 0.1.2
// @grant none
// @match https://twitter.com/*
// @require https://unpkg.com/jquery@3.6.0/dist/jquery.js
// @require https://unpkg.com/jquery.initialize@1.3.0/jquery.initialize.js
// @grant GM_addStyle
// @grant GM_setValue
// ==/UserScript==
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##

Using Unicorn with Upstart

This configuration works with Upstart on Ubuntu 12.04 LTS

The reason why it needs to be done this way (i.e. with the pre-start and post-stop stanzas), is because Upstart is unable to track whever Unicorn master process re-execs itself on hot deploys. One can use it without hot-deploys and run Unicorn in foreground also, it then only needs one exec stanza.

This presumes you are not using RVM, so no voodoo dances.

def self.prevent_recursion(method_name)
flag_name = "in:#{name}##{method_name}"
original = instance_method(method_name)
define_method(method_name) do |*args|
if Thread.current[flag_name]
return
else
begin
Thread.current[flag_name] = true
original.bind(self).call(*args)
@unicornrainbow
unicornrainbow / unmount_disk
Created January 18, 2014 07:37
Unmount a disk by name on OSX.
#! /usr/bin/env bash
disk=$(diskutil list | grep <Disk Name> | awk '{ print $6}')
diskutil unmount "/dev/$disk"
user sax staff;
worker_processes 1;
daemon off;
error_log /var/log/nginx/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
pid /var/run/nginx.pid;
@unicornrainbow
unicornrainbow / syria.md
Created September 11, 2013 06:49
A message from the president, which I received and he asked me to share.

Good evening --

I just addressed the nation about the use of chemical weapons in Syria.

Over the past two years, what began as a series of peaceful protests against the repressive regime of Bashar al-Assad has turned into a brutal civil war in Syria. Over 100,000 people have been killed.

In that time, we have worked with friends and allies to provide humanitarian support for the Syrian people, to help the moderate opposition within Syria, and to shape a political settlement. But we have resisted calls for military action because we cannot resolve someone else's civil war through force.

The situation profoundly changed in the early hours of August 21, when more than 1,000 Syrians -- including hundreds of children -- were killed by chemical weapons launched by the Assad government.

@unicornrainbow
unicornrainbow / gist:6432979
Created September 4, 2013 05:12
Differences between rails projects generated with --database with postgresq| versus mysql.
diff --git c/Gemfile i/Gemfile
index 36c38ba..e999a91 100644
--- c/Gemfile
+++ i/Gemfile
@@ -3,8 +3,8 @@ source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
-# Use postgresql as the database for Active Record
-gem 'pg'