Skip to content

Instantly share code, notes, and snippets.

@brain64bit
brain64bit / kfcrecipes.md
Created October 22, 2017 06:26
KFC 11 secret recipes:

KFC Secret Recipe:

Mix with 2 cups white flour:

  • 2/3 tablespoon salt
  • 1/2 tablespoon thyme
  • 1/2 tablespoon basil
  • 1/3 tablespoon oregano
  • 1 tablespoon celery salt
  • 1 tablespoon black pepper
  • 1 tablespoon dried mustard
  • 4 tablespoons paprika
require "rspec/core/formatters/base_text_formatter"
require 'headless'
require 'fileutils'
class AcceptanceVideoFormatter < RSpec::Core::Formatters::BaseTextFormatter
def initialize(output)
@headless = Headless.new(
video: {
nomouse: true,
@brain64bit
brain64bit / Selenium Cheat Sheet.md
Last active June 22, 2016 03:26 — forked from kenrett/Selenium Cheat Sheet.md
Selenium Cheat Sheet - Ruby
@brain64bit
brain64bit / gist:ede6789a0cca2b0804922630984d356a
Created June 2, 2016 12:11
How to debug why linux process being killed
sudo tail -f /var/log/kern.log
run the process who will killed
http://stackoverflow.com/questions/726690/who-killed-my-process-and-why
@brain64bit
brain64bit / README.md
Last active March 12, 2016 15:45 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@brain64bit
brain64bit / yosemite-gem-problem.md
Last active March 11, 2016 17:30
Ruby gems installation problem at Mac OSX Yosemite 10.11

Workaround for gems that cannot be installed easily on macosx yosemite

nokogiri 1.6.6.2

  • make sure nokogiri installed successfully
gem install nokogiri -v '1.6.6.2' -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries
  • add build config for bundle
bundle config build.nokogiri --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries
@brain64bit
brain64bit / README.md
Created February 4, 2016 09:13 — forked from quiver/README.md
Who says PostgreSQL can't Pub/Sub like Redis?

Pub/Sub pattern with PostgreSQL's LISTEN/NOTIFY command

This is a simple chat-like program using pub-sub pattern, backed by PostgreSQL's LISTEN/NOTIFY command.

Publish

publish message to foo channel from user nickname.

$ python pub.py foo nickname
PUBLISH to channel #foo
@brain64bit
brain64bit / gist:e60d6791acfd14d585ec
Created February 3, 2016 03:21 — forked from remy/gist:350433
Storage polyfill
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();

Note that this validation runs both after the file is uploaded and after CarrierWave has processed the image. If your base uploader includes a filter to resize the image then the validation will be run against the resized image, not the original one that was uploaded. If this causes a problem for you, then you should avoid using a resizing filter on the base uploader and put any specific size requirements in a version instead.

So instead of this:

require 'carrierwave/processing/mini_magick'

@brain64bit
brain64bit / sparqldemo
Last active December 15, 2015 19:49
Contoh SPARQL Tutorial v1.0 dari Wine RDF di Protege 4.2
SPARQL EXAMPLE WINE.RDF
// cari wine yg umurnya > 1997
prefix wine: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?object
WHERE { ?subject wine:yearValue ?y .