Skip to content

Instantly share code, notes, and snippets.

View Tester2009's full-sized avatar
💭
breathing

Мухаммад Алифф Муаззам Tester2009

💭
breathing
View GitHub Profile
@Tester2009
Tester2009 / 32.asm
Created June 13, 2017 05:19 — forked from ericandrewlewis/32.asm
NASM Hello World for x86 and x86_64 Intel Mac OS X(get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@Tester2009
Tester2009 / hex_to_rgb.py
Created June 15, 2017 22:11 — forked from matthewkremer/hex_to_rgb.py
Python Hex Code to RGB Value
def hex_to_rgb(hex):
hex = hex.lstrip('#')
hlen = len(hex)
return tuple(int(hex[i:i+hlen/3], 16) for i in range(0, hlen, hlen/3))
@Tester2009
Tester2009 / update_macports
Created June 16, 2017 06:54
macports update
# Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'
sudo port selfupdate
# The ports tree has been updated. To upgrade your installed ports, you should run
# port upgrade outdated
sudo port upgrade outdated
@Tester2009
Tester2009 / wikiapi.py
Last active June 21, 2017 01:09
get wiki revision info
# source: https://en.wikipedia.org/w/api.php?action=help&modules=query%2Brevisions
# https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=ids&format=json&&titles=Malaysia
# https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=json&&titles=Malaysia
import urllib2
import json
language = "en" # en, ar, ms
rvpop = "user|ids" # for content can use 'content' in rvpop parameter
@Tester2009
Tester2009 / getPETimestamp.py
Created June 28, 2017 05:27 — forked from geudrik/getPETimestamp.py
Read the PE Timestamp from a Windows Executable (PE) in Python
#! /usr/bin/env python2.7
#
# Author: Pat Litke (C) 2014
#
# This code is released under the WTFPL V2 http://www.wtfpl.net/
#
# License:
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
@Tester2009
Tester2009 / keybase.md
Created July 12, 2017 13:42
keybase.md

Keybase proof

I hereby claim:

  • I am tester2009-hakase on github.
  • I am tester2009 (https://keybase.io/tester2009) on keybase.
  • I have a public key ASBO1no3KzWl19M3Rj9HM_NQjJFYYkOrdgaIhU2ODkB8mwo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am tester2009 on github.
  • I am tester2009 (https://keybase.io/tester2009) on keybase.
  • I have a public key ASBO1no3KzWl19M3Rj9HM_NQjJFYYkOrdgaIhU2ODkB8mwo

To claim this, I am signing this object:

import sys
import base64
import string
m64='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/'
s64='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
def decode(d):
d=d.translate(string.maketrans(m64, s64))
return base64.b64decode(d)
@Tester2009
Tester2009 / get_integer_in_string.py
Last active December 3, 2017 06:10
Get integer in string
# sauce: https://stackoverflow.com/a/2500023
# improved with <3 by @tester2009. tester2009.hakase@gmail.com
string_1="101ismynumber001is not.letme try1number thatshouldb3 34zy"
try:
filter_int=''.join(x for x in string_1 if x.isdigit())
print(int(filter_int))
# result should be: 1010011334
except Exception, e:
# good way to code :)
@Tester2009
Tester2009 / ajax.html
Last active February 9, 2018 14:24
my first ajax (noob version)
<p id="showValue">Magic is here</p>
<button type="button" onclick="loadInfo()">Load</button>
<script>
function loadInfo() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readystate==4 && this.status==200) {
alert('Loaded');
document.getElementById("showValue").innerHTML=this.responseText;
}