Skip to content

Instantly share code, notes, and snippets.

View irsalshabirin's full-sized avatar
😊
:)

Irsal Shabirin irsalshabirin

😊
:)
  • 06:18 (UTC +07:00)
View GitHub Profile
@faisalman
faisalman / Rupiah.as
Created February 26, 2011 15:35
Konversi Angka ke format Rupiah & vice versa (C#, PHP, JavaScript, ActionScript 3.0)
package
{
/**
* ActionScript 3.0 Code Snippet
* Convert Number to Rupiah & vice versa
* https://gist.github.com/845309
*
* Copyright 2011-2012, Faisalman
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
@rponte
rponte / StringUtils.java
Last active April 10, 2024 23:01
Removing accents and special characters in Java: StringUtils.java and StringUtilsTest.java
package br.com.triadworks.rponte.util;
import java.text.Normalizer;
public class StringUtils {
/**
* Remove toda a acentuação da string substituindo por caracteres simples sem acento.
*/
public static String unaccent(String src) {
@yoggy
yoggy / gpu_hog.cpp
Created December 13, 2011 06:48
OpenCV cv::HOGDescriptor & cv::gpu::HOGDescriptor sample
#include <SDKDDKVer.h>
#include <Windows.h>
#pragma warning(disable:4819)
#pragma warning(disable:4996)
// for OpenCV2
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/gpu/gpu.hpp"
@9re
9re / ExifUtil.java
Created March 7, 2012 00:16
fix flipped / rotated image by getting exif orientation
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.os.Build;
@ksoichiro
ksoichiro / LinkUtils.java
Created August 19, 2012 11:22
Android: Clickable URL and clickable TextView
package com.blogspot.ksoichiro.linktest;
import android.text.Layout;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
@alexeds
alexeds / move-stashes.md
Created September 5, 2012 18:00
Move your stashes from one repo to another

Move your stashes from one repo to another


This was useful for me when we created a new branch for a new major release, but were still working on our current version as well. I cloned our repo again and kept the new project on our new branch, but also wanted to get my stashes there.

Download your stashes

git stash show -p > patch

You'll have to specify your stash and name your file whatevery you want. Do this for as all your stashes, and you'll have patch files in your pwd.

@michiexile
michiexile / gap.py
Created May 23, 2013 10:59
A Python implementation of the Gap Statistic from Tibshirani, Walther, Hastie to determine the inherent number of clusters in a dataset with k-means clustering.
# gap.py
# (c) 2013 Mikael Vejdemo-Johansson
# BSD License
#
# SciPy function to compute the gap statistic for evaluating k-means clustering.
# Gap statistic defined in
# Tibshirani, Walther, Hastie:
# Estimating the number of clusters in a data set via the gap statistic
# J. R. Statist. Soc. B (2001) 63, Part 2, pp 411-423
@katowulf
katowulf / firebase_copy.js
Last active July 29, 2022 15:58
Move or copy a Firebase path to a new location
function copyFbRecord(oldRef, newRef) {
oldRef.once('value', function(snap) {
newRef.set( snap.value(), function(error) {
if( error && typeof(console) !== 'undefined' && console.error ) { console.error(error); }
});
});
}
@debasishg
debasishg / gist:8172796
Last active March 15, 2024 15:05
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&amp;rep=rep1&amp;t
@hanxue
hanxue / embed-gist-in-blogger.js
Created January 18, 2014 10:48
Embed Gists in Blogger
At the end of your Blogger post , using HTML editor, append this
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script>
In the content of your blog post, simply add this:
<div class="gistLoad" data-id="8488564" id="gist-8488564">Loading https://gist.github.com/8488564....</div>
Note: adding the URL is useful because when the javascript does not work, readers can copy and paste the URL themselves.