Skip to content

Instantly share code, notes, and snippets.

View seanlilmateus's full-sized avatar

Mateus seanlilmateus

View GitHub Profile
@ktnr74
ktnr74 / service_call_test.py
Last active January 14, 2025 06:48
*update_transaction_codes.py* parses Android services source code to find out transaction codes and saves them in YAML format for later use. *transaction_codes.yaml* is an example of the resulting file. *service_call_test.py* shows how it can be used
#!/usr/bin/python
import os
import sys
import time
import yaml
import subprocess
import re
import struct
@pixlwave
pixlwave / core_ext.rb
Last active August 29, 2015 14:15
Swift style initializers for RubyMotion
class NSObject
def self.with(args = {})
args.count == 0 ? method = "init" : method = "initWith"
objc_args = []
args.each do |a|
a[0] = a[0][0].capitalize + a[0][1..-1] if objc_args.size < 1
method << a[0] << ":"
@pyrtsa
pyrtsa / version.bash
Last active March 23, 2023 06:47
Xcode: Set version and build number from Git
#!/bin/bash
# Xcode: Set version and build number from Git
# --------------------------------------------
#
# This script sets the version number `CFBundleShortVersionString` to one of
#
# - `1.2.3` -- for the tagged commit `v1.2.3` or a hyphen-separated prerelease,
# e.g. `v1.2.3-alpha`, `v1.2.3-alpha.2`, `v1.2.3-beta`, `v1.2.3-rc`.
# - `1.2.3-7-gabc1234` -- at commit `abc1234`, 7 commits after `v1.2.3`,
# - `1.2.3-7-gabc1234-dirty` -- when there are uncommitted changes, or
@mpasternacki
mpasternacki / freebsd_on_mbp.md
Created January 23, 2015 17:12
FreeBSD on a MacBook Pro

FreeBSD on a MacBook Pro

Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki

class Client < Android::OS::AsyncTask
def doInBackground(params)
url = Java::Net::URL.new("http://www.bom.gov.au/fwo/IDN60901/IDN60901.94768.json")
reader = Java::IO::BufferedReader.new(Java::IO::InputStreamReader.new(url.openStream))
builder = Java::Lang::StringBuilder.new("")
while ((line = reader.readLine()) != nil) do
builder.append(line)
end
puts builder.toString
//
// ViewController.swift
// Tetris
//
// Created by Julius Parishy on 11/19/14.
// Copyright (c) 2014 Julius Parishy. All rights reserved.
//
import UIKit

Why is Google blocking Inbox on Firefox?

Recently, Google launched a new service called Inbox. It's basically Gmail re-invented with a different UI and UX. It's a good tool which improved my ability to keep a zero email inbox. I'm currently using the Android application of Inbox and not at all on the desktop, since it's not available for Firefox, my default browser. This requires me to open up Inbox in Google Chrome if I want to see it. Opening up Inbox in Firefox gives the following message:

Image of Inbox message if using Firefox

But, I couldn't understand why it's only available in Google Chrome so I started investigating on why it's so.

User Agent hack

@trusktr
trusktr / DefaultKeyBinding.dict
Last active April 21, 2025 08:40
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@Tatsh
Tatsh / example-as.js
Last active May 16, 2020 07:29
Example AppleScript in JavaScript.
// Send a message to one person by name with Messages.app
function sendMessageTo(name, message) {
var app = Application('Messages');
var chats = app.chats(); // Get all the chats, regardless of service
var theChat;
for (var i = 0, len < chats.length; i < len; i++) {
chat = chats[i];
if (chat.participants().length > 1) { // Ignore 'rooms'
continue;