Skip to content

Instantly share code, notes, and snippets.

View CSaratakij's full-sized avatar
🎯
Focusing

Chatchai Saratakij CSaratakij

🎯
Focusing
View GitHub Profile
interface Fooable {
fun foo(): String
}
class FooImpl : Fooable {
override fun foo() = "I am fooImpl"
}
class AnotherFooImpl : Fooable {
override fun foo() = "I am anotherFooImpl"
# Author: spoonsearch
# Feel free to share and modify, and tag me in the modified version on devRant.
# Happy Ranting
$the_cow = <<EOC;
$thoughts
$thoughts
`..--:::::::::::--..` .
`.- :-.`
.- -.

Bomb Lab necessities

The bomb lab is most easily completed if you understand the following tools and commands. Also, if I am describing a program, assume that you run it from command line.

Strings

In case you have never used strings before it basically just tells you all the strings in an executable. If I were to run it on the bomb I would simply run

@5argon
5argon / csharp.json
Created July 11, 2018 20:16
Snippet for working with Unity ECS
{
// Place your snippets for csharp here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@andrewrk
andrewrk / log.txt
Created January 8, 2016 13:31
conversation about fast int types in #musl irc channel
[16:00:47] <andrewrk> in practice, are the int_fastN_t types worth using?
[16:01:04] <andrewrk> what about cache performance?
[16:01:26] <nsz> no but it has nothing to do with technical reasons
[16:01:40] <andrewrk> go on?
[16:02:26] <nsz> the standard failed to clearly specify the intent of these types (is it for fast storage access, arithmetics,..?)
[16:03:00] <nsz> and the consequence is that implementations (glibc/gcc) made horrible choices (int_fast16_t is 64bit on 64bit machines)
[16:03:08] <andrewrk> ugh
[16:03:24] <andrewrk> well I'm playing with a toy language / compiler and I'm thinking about integer types
[16:03:24] <nsz> so a int_fast16_t division is much slower than an int16_t one
[16:03:36] <andrewrk> so what if we were to toss out the spec and imagine it better?
@mnlwldr
mnlwldr / i3blocks.conf
Created June 25, 2016 15:19
Show the current active Window for i3blocks
[window_name]
command=xprop -id $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') | awk '/_NET_WM_NAME/{$1=$2="";print}' | cut -d'"' -f2
interval=1
color=#ffffff
@AidanRocke
AidanRocke / gitbook_on_github
Created April 28, 2018 23:20
Gitbook on Github pages
## taken from: http://sangsoonam.github.io/2016/08/02/publish-gitbook-to-your-github-pages.html
# install the plugins and build the static site
gitbook install && gitbook build
# checkout to the gh-pages branch
git checkout gh-pages
# pull the latest updates
git pull origin gh-pages --rebase
@alexlangberg
alexlangberg / dunstrc
Created May 27, 2015 22:19
Settings for dunst notifications. Colors from FlatStudio GTK theme (dark). Place in ~/.config/dunst/
[global]
font = Ubuntu 10
# Allow a small subset of html markup in notifications and formats:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
@estebanpadilla
estebanpadilla / AutoSnap.cs
Last active April 10, 2021 21:27
Auto snap to grid in Unity If you need to auto snap a gameObject to the grid in unity this script will help you. Usage: Create a Editor folder in your assets folder. Add the AutoSnap.cs script to the Editor folder. To open press Command + L (Mal), Control + L (PC) Source: http://answers.unity3d.com/questions/148812/is-there-a-toggle-for-snap-to-…
using UnityEngine;
using UnityEditor;
public class AutoSnap : EditorWindow
{
private Vector3 prevPosition;
private bool doSnap = true;
private float snapValue = 1;
[MenuItem( "Edit/Auto Snap %_l" )]