Skip to content

Instantly share code, notes, and snippets.

View kinow's full-sized avatar
💭
😬

Bruno P. Kinoshita kinow

💭
😬
View GitHub Profile
@muschneider
muschneider / nlp-pt-ex.groovy
Last active August 29, 2015 14:15
OpenNLP Portugue Example
@Grapes([
@Grab('org.apache.opennlp:opennlp-tools:1.5.2-incubating'),
@GrabExclude('jwnl:jwnl')
])
import opennlp.tools.postag.*
import opennlp.tools.sentdetect.*
import opennlp.tools.tokenize.*
def texto = "Pense bem. Quem casa quer casa."
anonymous
anonymous / relnotes.py
Created March 14, 2015 17:43
Hadoop's relnotes.py adapted for Jena release notes
#!/usr/bin/python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@cmbaughman
cmbaughman / generate_requires_setuppy.py
Created April 7, 2015 14:59
Automatically generate setup.py install_requires and dependency_links from a requirements.txt file.
import os
import re
def which(program):
"""
Detect whether or not a program is installed.
Thanks to http://stackoverflow.com/a/377028/70191
"""
def is_exe(fpath):
return os.path.exists(fpath) and os.access(fpath, os.X_OK)
@non
non / answer.md
Last active February 28, 2025 11:46
answer @nuttycom

What is the appeal of dynamically-typed languages?

Kris Nuttycombe asks:

I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?

I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.

I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.

@1000k
1000k / Pure CSS3 image gallery with Flexbox (responsive).markdown
Last active March 9, 2021 00:55
Pure CSS3 image gallery with Flexbox (responsive)
@paulirish
paulirish / what-forces-layout.md
Last active May 8, 2025 05:49
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@kinow
kinow / linux_tips.md
Created September 23, 2015 22:22
Linux tips

##Grep for content within XML tags

grep -oP "(?<=<bla:Username>).*?(?=</bla:Username>)" app/logs/test.curl.log

Search for strings in Jenkins jobs

for x in ls -d */; do grep -r -H "srv" ${x}/workspace >> /tmp/srv; done

List packages in SLES and origin repo

@sturdy5
sturdy5 / README.md
Last active July 3, 2017 16:07
Dashing BitBucket Repo Stats

Description

This is a Dashing widget that is based on the Dashing GitHub Stats widget. This widget displays Last Activity, Open Issues, Open Pulls, Forks, and Watchers of a given set of BitBucket repositories.

Setup

  1. You can either copy and paste these files on your own, or you can use dashing install 15a542122b198449903d to copy the files into your dashing directory in place.
  2. Edit the bitbucket.yml file to configure the widget. An example configuration is below.
  3. Add bitbucket_rest_api and actionview gems to your Gemfile and run bundle install
  4. Add the widget to your dashboard erb file. The data-id value is the repository you want to display information for. An example is below.
@kinow
kinow / gist:ff6a3e33e094a17be70246ad4ece86e3
Created August 20, 2016 01:49
Release jenkins plugin with maven
JAVA_HOME=/usr/lib/jvm/java-7-oracle/ mvn org.apache.maven.plugins:maven-release-plugin:2.5:prepare
@mattiaslundberg
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active January 30, 2025 19:01
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)