Skip to content

Instantly share code, notes, and snippets.

View rashiq's full-sized avatar
☃️
hi

Rashiq rashiq

☃️
hi
View GitHub Profile
@willscott
willscott / analytics.conf
Created November 12, 2016 18:49
Google Analytics Proxy
location = /analytics.js {
proxy_hide_header Alt-Svc;
resolver 8.8.8.8 ipv6=off;
proxy_pass https://www.google-analytics.com/analytics.js;
break;
}
location = /analytics {
access_by_lua_block {
ngx.req.read_body()
local body = ngx.req.get_body_data()
@mttkay
mttkay / Pager.java
Created November 4, 2015 15:46
A simple Rx based pager
public class Pager<I, O> {
private static final Observable FINISH_SEQUENCE = Observable.never();
private PublishSubject<Observable<I>> pages;
private Observable<I> nextPage = finish();
private Subscription subscription = Subscriptions.empty();
private final PagingFunction<I> pagingFunction;
private final Func1<I, O> pageTransformer;
@rlemon
rlemon / autobin.js
Last active August 29, 2015 14:11
auto bin gifs.
// ==UserScript==
// @name SO Chat room gif autobinner
// @author Robert Lemon
// @version 0.0.32
// @namespace
// @description make rooms not suffer gifs
// @include http://chat.stackoverflow.com/rooms/*
// ==/UserScript==
(function(global) {
"use strict";
@michellechandra
michellechandra / README.md
Last active February 13, 2025 16:07
Basic US State Map - D3
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active September 4, 2024 05:58
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* 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
@rlemon
rlemon / README.md
Last active December 20, 2016 20:36
so snippets userscript WIP

so chat snippets

okay here is the deal, this is a WIP and i'm still working on it but in the meantime you might enjoy it.

install by downloading the script, and dragging and dropping on chrome://extensions/

refresh the chat page and click the 'snippets' button.

the interface is pretty simple:

@chrisbanes
chrisbanes / ForegroundLinearLayout.java
Created February 19, 2014 13:16
ForegroundLinearLayout
/*
* Copyright (C) 2006 The Android Open Source Project
*
* 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
@bodiam
bodiam / gutenberg_rsync.sh
Created September 8, 2013 18:51
This script mirrors the gutenberg cache of generated file formats.
#!/bin/bash
# This script mirrors the gutenberg cache
# of generated file formats
# By Braddock Gaskill 2013
DIR=/knowledge/data/gutenberg/cache/generated
mkdir -p "${DIR}"
cd "${DIR}"
pwd
while (true); do
@romannurik
romannurik / AndroidCreateGhostIcon.java
Created June 14, 2013 06:28
Android ColorMatrixColorFilter example: Creates a 'ghost' bitmap version of the given source drawable (ideally a BitmapDrawable). In the ghost bitmap, the RGB values take on the values from the 'color' argument, while the alpha values are derived from the source's grayscaled RGB values. The effect is that you can see through darker parts of the …
/**
* Creates a 'ghost' bitmap version of the given source drawable (ideally a BitmapDrawable).
* In the ghost bitmap, the RGB values take on the values from the 'color' argument, while
* the alpha values are derived from the source's grayscaled RGB values. The effect is that
* you can see through darker parts of the source bitmap, while lighter parts show up as
* the given color. The 'invert' argument inverts the computation of alpha values, and looks
* best when the given color is a dark.
*/
private Bitmap createGhostIcon(Drawable src, int color, boolean invert) {
int width = src.getIntrinsicWidth();
@dodyg
dodyg / gist:5616605
Last active November 21, 2022 03:05
Kotlin Programming Language Cheat Sheet Part 2

This is a quick guide to Kotlin programming language. The previous part of this guide is here

#Object Oriented

fun main(args : Array<String>) {
  class local (val x : Int)
  
  val y = local(10)
 println("${y.x}")