Skip to content

Instantly share code, notes, and snippets.

View MythodeaLoL's full-sized avatar
💔
love is a ilusion 😿

Flo Rida MythodeaLoL

💔
love is a ilusion 😿
  • Dev
  • Brazil
  • 10:02 (UTC -03:00)
View GitHub Profile
@trueroad
trueroad / Makefile
Last active April 12, 2023 01:06
Unicode Filename Support for MinGW.org / MinGW-w64 Platform Software (hook)
CXX = i686-w64-mingw32-g++
testmain: testmain.cc mingw-utf8-main.cc mingw-utf8-hook.cc \
mingw-utf8-func.cc mingw-utf8-conv.cc
$(CXX) -static -o testmain testmain.cc \
mingw-utf8-main.cc mingw-utf8-hook.cc \
mingw-utf8-func.cc mingw-utf8-conv.cc \
-ldbghelp
clean:
@aaronhurt
aaronhurt / curltest.c
Last active August 24, 2025 12:09
example code using libcurl and json-c to post and parse a return from http://jsonplaceholder.typicode.com
/**
* example C code using libcurl and json-c
* to post and return a payload using
* http://jsonplaceholder.typicode.com
*
* License:
*
* This code is licensed under MIT license
* https://opensource.org/licenses/MIT
*
@douzifly
douzifly / gist:11086408
Created April 19, 2014 14:43
android get package name from jni
static jstring getpkg(JNIEnv* env, jobject thiz, jobject activity) {
jclass android_content_Context =env->GetObjectClass(activity);
jmethodID midGetPackageName = env->GetMethodID(android_content_Context,"getPackageName", "()Ljava/lang/String;");
jstring packageName= (jstring)env->CallObjectMethod(activity, midGetPackageName);
return packageName;
}
@HaNdTriX
HaNdTriX / image_to_data_url.js
Last active November 20, 2024 13:00
Convert an image to base64URL.
/**
* Converts an image to a dataURL
* @param {String} src The src of the image
* @param {Function} callback
* @param {String} outputFormat [outputFormat='image/png']
* @url https://gist.github.com/HaNdTriX/7704632/
* @docs https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement#Methods
* @author HaNdTriX
* @example
*
@dalethedeveloper
dalethedeveloper / gist:1503252
Created December 20, 2011 21:00
Mobile Device Detection via User Agent RegEx

#Mobile Device Detection via User Agent RegEx

Yes, it is nearly 2012 and this exercise has been done to death in every imaginable language. For my own purposes I needed to get the majority of non-desktop devices on to a trimmed down, mobile optimized version of a site. I decided to try and chase down an up-to-date RegEx of the simplest thing that could possibly work.

I arrived at my current solution after analyzing 12 months of traffic over 30+ US based entertainment properties (5.8M+ visitors) from Jan - Dec 2011.

The numbers solidified my thoughts on the irrelevancy of including browsers/OSes such as Nokia, Samsung, Maemo, Symbian, Ipaq, Avant, Zino, Bolt, Iris, etc. The brass tacks of the matter is that you certainly could support these obscure beasts, but are you really going to test your site on them? Heck, could you even find one?! Unless the folks that pay you are die hard Treo users my guess is "No".

Interestingly enough my research shows that /Mobile/ is more efficient than **/iP(

@rampion
rampion / try-catch-ex.c
Created April 8, 2009 02:35
TRY/CATCH/FINALLY macros for C
// gcc -o try-catch-ex try-catch.c try-catch-ex.c
#include <stdio.h>
#include "try-catch.h"
// Example of use for try-catch.h
int main(int argc, char *argv[])
{
int i = 101;
printf("before try block...\n");