Skip to content

Instantly share code, notes, and snippets.

View katopz's full-sized avatar
🦀
Rust me if you can

Todsaporn Banjerdkit katopz

🦀
Rust me if you can
View GitHub Profile
@epologee
epologee / Signal.h
Created January 24, 2011 19:13
Simple Objective-C take on Robert Penner's Signals-AS3
//
// Signal.h
//
// Created by Eric-Paul Lecluse on 22-01-11.
// Copyright 2011 epologee. All rights reserved.
//
// This class was actually inspired and named by the brilliant work of Robert Penner & friends
// with the ActionScript 3.0 library called Signals: https://github.com/robertpenner/as3-signals
// It's not even close to a port, but it meets the demands of my current project.
@pklaus
pklaus / clearRAM.sh
Last active September 9, 2024 17:09
A Script to Clear Cached RAM on Linux
#!/bin/bash
## Bash Script to clear cached memory on (Ubuntu/Debian) Linux
## By Philipp Klaus
## see <http://blog.philippklaus.de/2011/02/clear-cached-memory-on-ubuntu/>
if [ "$(whoami)" != "root" ]
then
echo "You have to run this script as Superuser!"
exit 1
fi
@derencius
derencius / xcode.rb
Created March 10, 2011 03:05
Download Xcode using wget. Useful for slow or intermittent connections. it uses wget and mechanize.
require 'rubygems'
require 'mechanize'
if ARGV.size < 3
puts %q{Usage: ruby xcode.rb USERNAME PASSWORD "DOWNLOAD_URL" [WGET_PARAMS]}
puts %q{Example: ruby xcode.rb [email protected] 123456 "https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_4_and_ios_sdk_4.3__final/xcode_4_and_ios_sdk_4.3__final.dmg" }
exit
end
a = Mechanize.new { |agent|
@jhurliman
jhurliman / base64.js
Created September 29, 2011 06:39 — forked from Marak/base64.js
An extremely simple implementation of base64 encoding / decoding using node.js Buffers (plus url-safe versions)
/*
* base64.js: An extremely simple implementation of base64 encoding / decoding using node.js Buffers
*
* (C) 2010, Nodejitsu Inc.
* (C) 2011, Cull TV, Inc.
*
*/
var base64 = exports;
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

/*
Gyroscope の ANE に付属の Gyroscope クラスをインポートして使用しています。
プロジェクトは FlashBuilder の ActionScript モバイルプロジェクトを
AIR for iOS(AIR 3.3)でビルドしました。
link
http://www.digifie.jp/blog/archives/998
http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/gyroscope.html
*/
@alebianco
alebianco / SendBytes.java
Last active September 23, 2016 14:46
Work with ByteArray on an AIR Native Extension
/**
* Project: ANE-Google-Analytics
*
* Author: Alessandro Bianco
* Website: http://alessandrobianco.eu
* Twitter: @alebianco
* Created: 23/12/12 10.42
*
* Copyright © 2013 Alessandro Bianco
*/
@adelevie
adelevie / md5.js
Created January 7, 2013 23:03
This should allow you create MD5 hashes within Parse Cloud Code. Just copy `md5.js` into the `cloud` folder. See `usage.js` for a basic example. I used the JS MD5 implementation found here: http://pajhome.org.uk/crypt/md5/md5.html
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
/*
package async
{
public class Deferred implements Promise
{
private const pending:Array = [];
private var processed:Boolean;
private var completed:Boolean;
@jamiechapman
jamiechapman / ParseProxyObject.java
Last active March 14, 2019 07:37
A Parse.com Serializable ParseObject Proxy
// By Jamie Chapman, @chappers57
// License: open, do as you wish, just don't blame me if stuff breaks ;-)
public class ParseProxyObject implements Serializable {
private static final long serialVersionUID = 1L;
private HashMap<String, Object> values = new HashMap<String, Object>();
public HashMap<String, Object> getValues() {
return values;