Skip to content

Instantly share code, notes, and snippets.

View surfer190's full-sized avatar
🌆

surfer190 surfer190

🌆
  • South Africa
View GitHub Profile
@surfer190
surfer190 / top-tracks.md
Last active March 5, 2023 12:54
Top tracks

Rock

  • ACDC - Hells Bells
  • Aerosmith - Dream On
  • Lynard Skynard - Simple Man
  • Bon Jovi - Wanted Dead Or Alive
  • Gerry Rafferty - Baker Street
  • Bob Seger - Turn the Page
  • Bob Seger - Main Street
  • Foreigner - Urgent
@grantland
grantland / post.md
Last active February 9, 2023 05:09
RecyclerView item onClick

RecyclerView item onClick

RecyclerView does not have an OnItemClickListener like it's predecessor, ListView. However, detecting item clicks is pretty simple.

Set an OnClickListener in your ViewHolder creation:

private class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder>  {

    public static class ViewHolder extends RecyclerView.ViewHolder
@mvasilenko
mvasilenko / gist:b8c47616fa74de63dcc030508c53e7c1
Last active December 30, 2022 08:51
goaccess nginx apm log format template
time-format %T
date-format %d/%b/%Y
log_format "%d:%t +%^" client=%h method=%m request="%r" request_length=%^ status=%s bytes_sent=%b body_bytes_sent=%^ referer=%R user_agent="%^" upstream_addr=%^ upstream_status=%^ request_time=%T upstream_response_time=%^ upstream_connect_time=%^ upstream_header_time=%^
@tegansnyder
tegansnyder / opcache.ini
Last active September 2, 2022 16:24
OpCache settings for Magento on PHP 5.5.14. Store this file as /etc/php.d/opcache.ini
; Enable Zend OPcache extension module
zend_extension=opcache.so
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=0
; The OPcache shared memory storage size.
@alces
alces / ansible_ad_hoc_inventories.md
Last active September 2, 2022 07:17
Using Ad-hoc Inventories in Ansible

In case you want to run ansible (or ansible-playbook) command against a set of hosts that makes sense only for one run, you can don't bother to create one-time inventory file, but simply define a comma-separated list of hosts as argument of --invertory option (or its short form that's simply -i) as follows:

ansible --inventory=myhost1,myhost2,myhost3 all -m setup -a 'filter=*name*'

(note that all in this command line stands for the target hostname)

If you have only one host to run your playbook against, your inventory string must ends with ,

@garethrees
garethrees / gist:5591027
Last active October 14, 2020 19:44
Ansible set timezone on Ubuntu host
- name: Group by Distribution
hosts: all
tasks:
- group_by: key=${ansible_distribution}
- name: Set Time Zone
hosts: Ubuntu
gather_facts: False
tasks:
- name: Set timezone variables
@davetrux
davetrux / SQLiteDebugADB
Created March 24, 2014 14:42
Verbose Logging of SQLite statements in Android
adb shell setprop log.tag.SQLiteLog V
adb shell setprop log.tag.SQLiteStatements V
adb shell stop
adb shell start
@mukundthanki
mukundthanki / My Magento Code.php
Last active May 31, 2018 09:24 — forked from claudiu-marginean/My Magento Code.php
Magento: Code Snippets
<block type="cms/block" name="block_name">
<action method="setBlockId"><id>block_code</id></action>
</block>
{{block type="cms/block" block_id="block_code"}}
{{block type="catalog/product_list" category_id="79" template="catalog/product/list_random.phtml"}}
@maderlock
maderlock / C3\Utility\DuplicateDatabase.php
Created September 2, 2016 11:03
PHP class to duplicate database
<?php
namespace C3\Utility;
use Monolog\Logger;
/**
* Class DuplicateDatabase
*
* @package C3\Utility
@toast38coza
toast38coza / docker-compose-postgres.yml
Last active January 6, 2018 21:44
Docker-compose files for Kong
version: "2"
services:
postgres:
image: postgres:9.4
container_name: kong-database
ports:
- "5432:5432"
environment:
- POSTGRES_USER=kong