Skip to content

Instantly share code, notes, and snippets.

@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 .

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 / 0. nginx_setup.sh
Last active February 19, 2018 16:11 — forked from mikhailov/0. nginx_setup.sh
Nginx conf setup
# Nginx+Unicorn best-practices congifuration guide. Now with SPDY!
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
/**
*
* Also see comments on the function main().
*
* Depends only on the libs that come with elasticsearch:
* elasticsearch-0.15.2.jar
* lucene*.jar
*
* Place the ElasticTest.java file and the above jars in the same folder.
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@brain64bit
brain64bit / install-ruby-win7.md
Last active August 29, 2015 14:03
Install Ruby 2, Rails 4.1.1 and RMagick on Windows 7

Installation Ruby 2.0.0, Rails 4.1.1, Rmagick 2.13.2 on Windows 7

Installing rails and its dependencies always painfull in windows, thankfully to railsinstaller or rubyinstaller but here i want show how install ruby, rails and rmagick based on my experience:

  1. First install rails FTW, its like railsinstaller but at least more latest ruby and rails than railsinstaller. Its contain ruby 2.0.0-p481 32bit and rails 4.1.1
  2. In here you've got ruby 2.0.0 and rails 4.1.1 installed in your system. Open your cmd and type ruby -v and rails -v to make sure ruby on rails installed properly.
  3. Download Devkit 4.7.2 32bit
  4. Download ImageMagick-6.7.9-9-Q16-windows-dll.exe install on C:/imagemagick
  5. from
<link rel="import" href="../core-pages/core-pages.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@brain64bit
brain64bit / Ansibel
Last active August 29, 2015 14:07 — forked from yudapc/Ansibel
$ sudo apt-get install python-pip
$ sudo pip install boto
$ sudo pip install https://github.com/KMK-ONLINE/ansible/zipball/elasticache_redis_vpc
create new file with name "hostfile" :
[yudaserver]
128.199.146.166
create new file with name "nginx.yml" :
- name: DEPLOYMENT