Skip to content

Instantly share code, notes, and snippets.

View akhy's full-sized avatar

Akhyar Amarullah akhy

View GitHub Profile
@maxkandler
maxkandler / gist:5233150
Created March 24, 2013 19:25
Hide the iTerm2 Dock icon.
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist
@jirutka
jirutka / analytics.conf
Created March 31, 2013 01:03
Add Google Analytics tracking code to HTML via nginx
#
# Add Google Analytics tracking code to HTML response
#
# Usage:
# set $tracking_id 'UA-12345678-9';
# include incl/analytics.conf;
#
# It needs nginx compiled with option --with-http_sub_module.
# Uses optimized GA code from: http://mathiasbynens.be/notes/async-analytics-snippet
#
@julianshen
julianshen / CircleTransform.java
Last active November 6, 2023 12:47
CircleTransform for Picasso
/*
* Copyright 2014 Julian Shen
*
* 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
@orip
orip / PicassoUtils.java
Last active July 18, 2018 08:39
Working around https://github.com/square/okhttp/issues/184 for Picasso 2.x (older revisions for Picasso 1.1.1)
package com.example;
import android.content.Context;
import com.squareup.okhttp.HttpResponseCache;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.picasso.OkHttpDownloader;
import com.squareup.picasso.Picasso;
import javax.net.ssl.SSLContext;
import java.io.File;
@akhy
akhy / WeakTask.java
Created August 23, 2013 10:24
Wrapper abstract class for Android's built-in AsyncTask with weak reference to target object. For example you can do any image processing in background (asynchronously) and set the output to a garbage collectible ImageView once completed. If for some reason the ImageView isn't available anymore (e.g. due to user switching activity), the `applyOu…
package net.akhyar.android.async;
import java.lang.ref.WeakReference;
import android.os.AsyncTask;
public abstract class WeakTask<I, O, T> extends AsyncTask<Void, Void, O> {
protected final WeakReference<T> targetRef;
protected I input;
public WeakTask(I input, T target) {
@namuol
namuol / INSTALL.md
Last active December 11, 2024 12:21
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active May 6, 2025 10:00
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@abayer
abayer / jenkins-git-backup.sh
Last active June 7, 2025 03:08
Example of a script for backing up Jenkins config in git.
#!/bin/bash
#
# Copies certain kinds of known files and directories from a given Jenkins master directory
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em.
#
set -ex
if [ $# -ne 2 ]; then
echo usage: $0 root_dir jenkins_master
@diorahman
diorahman / index.html
Created June 25, 2014 01:34
Peta Rupa Bumi. Menampilkan peta dasar dari layanan SatuPeta Badan Informasi Geospasial Indonesia. Kami berharap mereka akan segara lompat ke "stack" kode sumber terbuka. Informasi sumber data: http://data.ukp.go.id/dataset/rupa-bumi-indonesia dan rilis dengan Web Mercator Auxiliary Sphere tiling scheme (WKID 102100/3857) dan memakai default sca…
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title></title>
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
<style>
html, body, #map {
height: 100%; width: 100%; margin: 0; padding: 0;
/*
* Copyright (C) 2014 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