Skip to content

Instantly share code, notes, and snippets.

View marcandreappel's full-sized avatar

Marc-André Appel marcandreappel

View GitHub Profile
@ccjeng
ccjeng / CustomInfoWindowAdapter.java
Last active February 27, 2024 12:40
Custom InfoWindow Layout for Google Map in Android
public class CustomInfoWindowAdapter implements GoogleMap.InfoWindowAdapter {
private Activity context;
public CustomInfoWindowAdapter(Activity context){
this.context = context;
}
@Override
@bolot
bolot / PeekingLinearLayoutManager.kt
Last active August 30, 2023 07:19
LinearLayoutManager subclass that "peeks", shows a portion of the adjacent child views.
class PeekingLinearLayoutManager : LinearLayoutManager {
@Suppress("Unused")
@JvmOverloads
constructor(context: Context?, @RecyclerView.Orientation orientation: Int = RecyclerView.VERTICAL, reverseLayout: Boolean = false) : super(context, orientation, reverseLayout)
@Suppress("Unused")
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes)
override fun generateDefaultLayoutParams() =
scaledLayoutParams(super.generateDefaultLayoutParams())
@uriel1998
uriel1998 / volume.rb
Created February 10, 2012 17:55 — forked from jaspervdj/volume.rb
Set PulseAudio volume, mute, unmute, and change default sink (and automagically switch running audio streams) from the commandline
#!/usr/bin/ruby
#
# Moved to: https://github.com/uriel1998/volumerb
#
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
# Unported License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-sa/3.0/.
#
# Forked/derived from original by Jasper Van der Jeugt (jaspervdj);
@beanmoss
beanmoss / RestControllerTrait.php
Created April 18, 2015 12:12
Playing with Laravel Lumen: simple RESTful trait.
<?php namespace App\Http\Controllers;
use Illuminate\Http\Request;
trait RestControllerTrait
{
public function index()
{
$m = self::MODEL;
return $this->listResponse($m::all());
@remy
remy / hmr-index.js
Created June 1, 2017 12:27
A take on HMR. I don't remember exactly where it came from, but it works for me.
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import store from './store';
const rootEl = document.getElementById('root');
// Create a reusable render method that we can call more than once
let render = () => {
// Dynamically import our main App component, and render it
@huglester
huglester / gist:3860656
Created October 9, 2012 18:48
FuelPHP PHPStorm helper class
<?php
class Agent extends Fuel\Core\Agent {}
class Arr extends Fuel\Core\Arr {}
class Asset extends Fuel\Core\Asset {}
class Cache extends Fuel\Core\Cache {}
class CacheNotFoundException extends Fuel\Core\CacheNotFoundException {}
class CacheExpiredException extends Fuel\Core\CacheExpiredException {}
class Cli extends Fuel\Core\Cli {}
class Config extends Fuel\Core\Config {}
@marcandreappel
marcandreappel / states_provinces.php
Created August 29, 2011 13:35
Concrete5 - Liste des départements de la France dans : helpers / lists / states_provinces.php, il faut remplacer le fichier (ou son contenu) par le fichier ci-dessous
<?
/**
* @package Helpers
* @category Concrete
* @author Andrew Embler <andrew@concrete5.org>
* @copyright Copyright (c) 2003-2008 Concrete5. (http://www.concrete5.org)
* @license http://www.concrete5.org/license/ MIT License
*/
/**