Skip to content

Instantly share code, notes, and snippets.

@gabrielemariotti
gabrielemariotti / Readme.md
Last active March 2, 2024 23:10
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@staltz
staltz / introrx.md
Last active April 20, 2024 14:15
The introduction to Reactive Programming you've been missing
@simenbrekken
simenbrekken / gulpfile.js
Created March 14, 2014 08:54
React project gulpfile
var gulp = require('gulp'),
gutil = require('gulp-util')
// HTML
gulp.task('html', function() {
return gulp.src('src/index.html')
.pipe(gulp.dest('build'))
})
// Scripts
@tomtung
tomtung / Week1 - Ruby.rb
Created June 13, 2012 08:45
Seven Languages in Seven Weeks
#!/usr/bin/ruby
############# Day 1 #############
# Print the string “Hello, world.”
puts 'Hello, world'
# For the string “Hello, Ruby”, find the index of the word“Ruby”.
puts 'Hello, Ruby'.index('Ruby')
@mblondel
mblondel / lda_gibbs.py
Last active October 9, 2023 11:31
Latent Dirichlet Allocation with Gibbs sampler
"""
(C) Mathieu Blondel - 2010
License: BSD 3 clause
Implementation of the collapsed Gibbs sampler for
Latent Dirichlet Allocation, as described in
Finding scientifc topics (Griffiths and Steyvers)
"""
import bisect
class NFA(object):
EPSILON = object()
ANY = object()
def __init__(self, start_state):
self.transitions = {}
self.final_states = set()
self._start_state = start_state