Skip to content

Instantly share code, notes, and snippets.

@thnt
thnt / 30m-zig.md
Created January 6, 2021 02:41 — forked from ityonemo/test.md
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@thnt
thnt / youtube_topicIDs.md
Created August 18, 2020 07:56 — forked from stpe/youtube_topicIDs.md
YouTube Topic IDs

Music topics

  • /m/04rlf Music
  • /m/05fw6t Children's music
  • /m/02mscn Christian music
  • /m/0ggq0m Classical music
  • /m/01lyv Country
  • /m/02lkt Electronic music
  • /m/0glt670 Hip hop music
  • /m/05rwpb Independent music
@thnt
thnt / frida_multiple_unpinning.js
Created July 28, 2020 04:51 — forked from akabe1/frida_multiple_unpinning.js
Another Android ssl certificate pinning bypass for various methods
/* Android ssl certificate pinning bypass script for various methods
by Maurizio Siddu
Run with:
frida -U -f [APP_ID] -l frida_multiple_unpinning.js --no-pause
*/
setTimeout(function() {
Java.perform(function () {
console.log('');
@thnt
thnt / go-shebang-story.md
Created November 30, 2019 03:16 — forked from posener/go-shebang-story.md
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

User authentication system

Your task is now to create a user authentication system.

This document will guide you through all the features and implication of such system, so that you don't have to search them yourself.

We will focus on web/browser-technologies, however similar concept can be widely applied. This guide, is a work in progress, feel free to comment and provide feedbacks.

Expected Workflows

@thnt
thnt / git-cheat-list.md
Created October 5, 2016 16:30
Git cheat list

Git cheat list

  • list last 20 hashes in reverse

    git log -n 20 --reverse --format="%h %ae %s" --abbrev-commit
    
  • try a new output for diffing

    git diff --compaction-heuristic ...
    

--color-words ...

@thnt
thnt / objects_arrays.md
Created January 15, 2016 07:23 — forked from nikic/objects_arrays.md
Post explaining why objects often use less memory than arrays (in PHP)

Why objects (usually) use less memory than arrays in PHP

This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)

The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array part of it away. So how does that work?

The key here is that objects usually have a predefined set of keys, whereas arrays don't:

@thnt
thnt / cookies.js
Created December 26, 2015 03:54 — forked from ajaxray/cookies.js
Small JavaScript class to help create, read and delete cookie.
/**
* Cookies - A small class to manipulate cookies from javascript
*
* Compressed version: https://gist.github.com/4147384
*
* @see www.quirksmode.org/js/cookies.html
* @author Anis uddin Ahmad <anisniit@gmail.com>
*/
window.Cookies = {
@thnt
thnt / gist:b3b63deff9bee62e6638
Last active August 29, 2015 14:18
Balsamiq Mockups 2.2.22 for mac key
Name : Sam
Serial : eJzzzU/OLi0odswsqglOzK0xsjQzNzI2NjA1q3GuMQQAnJAJjw==
@thnt
thnt / Requests.php
Last active August 29, 2015 14:09 — forked from xeoncross/Requests.php
<?php
/**
* Make asynchronous requests to different resources as fast as possible and process the results as they are ready.
*/
class Requests
{
public $handle;
public function __construct()
{