Skip to content

Instantly share code, notes, and snippets.

View RiansyahTohamba's full-sized avatar
💭
on learning

Riansyah Tohamba RiansyahTohamba

💭
on learning
View GitHub Profile
# chunk by np-chunk
def get_chunk_np(sentence):
grammar = "NP: {<DT>?<JJ>*<NN>}"
cp = nltk.RegexpParser(grammar)
result = cp.parse(sentence)
return result
<?php
use Illuminate\Contracts\Console\Kernel;
require_once __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Bootstrap The Test Environment
|--------------------------------------------------------------------------
@RiansyahTohamba
RiansyahTohamba / gitlab-ci.yml
Created September 24, 2019 03:55
example CI using selenium with firefox driver
image: python:3.7
stages:
- test
- deploy
development:
stage: test
before_script:
- pip install -r requirements.txt
https://github.com/learnbyexample/Command-line-text-processing/blob/master/ruby_one_liners.md
@RiansyahTohamba
RiansyahTohamba / gist:0e8e141ed2ed7f489d60c339375d080f
Last active June 29, 2018 09:23
carriewave avoid reupload image because
https://github.com/carrierwaveuploader/carrierwave#making-uploads-work-across-form-redisplays
tapi jangan buat attr_accesible, karena carrierwave sudah menggenerate name_cache(name bisa avatar,photo dll) nya
tambahkan name_cache di strong paramater di controller
@RiansyahTohamba
RiansyahTohamba / gist:c1bff8b665e771d56aa0d5ccea95d71f
Created June 29, 2018 01:27
show us the file and the line where the Uglifier is making the problem.
JS_PATH = "app/assets/javascripts/**/*.js";
Dir[JS_PATH].each do |file_name|
puts "\n#{file_name}"
puts Uglifier.compile(File.read(file_name))
end