Skip to content

Instantly share code, notes, and snippets.

View dalinaum's full-sized avatar
:octocat:
Learning Rust and IR.

LYK dalinaum

:octocat:
Learning Rust and IR.
View GitHub Profile
@sanxiyn
sanxiyn / lisp.c
Created August 14, 2010 04:16
Lisp
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
enum type {
NIL,
@devunwired
devunwired / GifDecoder.java
Last active January 26, 2024 21:14
An optimized implementation of GifDecoder for Android devices.
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@paulmillr
paulmillr / dart.md
Last active July 15, 2023 13:36
Leaked internal google dart email

---------- Forwarded message ----------

From: Mark S. Miller <erights@google.com>
Date: Tue, Nov 16, 2010 at 3:44 PM
Subject: "Future of Javascript" doc from our internal "JavaScript Summit"
last week
To: javascript-standard@google.com
@JakeWharton
JakeWharton / OkHttpStack.java
Created May 21, 2013 01:14
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
* uses OkHttp as its transport.
*/
/*
* Copyright (C) 2011 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
@keedi
keedi / rename.pl
Created November 30, 2010 04:52
rename
#!/usr/bin/perl -w
#
# This script was developed by Robin Barker (Robin.Barker@npl.co.uk),
# from Larry Wall's original script eg/rename from the perl source.
#
# This script is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
# Larry(?)'s RCS header:
# RCSfile: rename,v Revision: 4.1 Date: 92/08/07 17:20:30
@briandfoy
briandfoy / github2ohloh.pl
Created July 27, 2012 19:43
Add Github projects to Ohloh
#!/usr/bin/perl
use v5.14;
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new->max_redirects(5);
my $user = $ENV{GITHUB_USER} // '...';
my @committer_names = ( '...', '...', );
$ENV{OHLOH_USER} //= '...';
@f2prateek
f2prateek / CheckBoxActionProvider.java
Created October 30, 2012 18:26
Custom Action Provider in ActionBar - a checkbox with a textview descrption
package com.psrivastava.deviceframegenerator.widget;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.TextView;
import android.widget.Toast;
@givenjazz
givenjazz / gist:5626084
Last active April 19, 2016 12:39
It's BitmapCache for ImageLoader.ImageCache of Volley. It rarely use memory through WeakReference. And it's thread-safety.
/*
* Copyright 2013 Hi Zeon
* Copyright 2011 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
*
@acidsound
acidsound / TinyGCMServer.go
Last active December 14, 2015 17:19
1. go get github.com/googollee/go-gcm 2. go build TinyGCMServer.go 3. ./TinyGCMServer.go <API_KEY> <Server URL(:port)>
// +build !appengine
package main
/*
* Usage: ./TinyGCMServer <API_KEY> <Server URL(:port)>
* Test: curl -d "<NOTIFICATION MESSAGE>" http://serverURL/sendMessage?target=<REGISTRATION_ID>
*/
import (
"fmt"
gcm "github.com/googollee/go-gcm"