Skip to content

Instantly share code, notes, and snippets.

View 20chan's full-sized avatar
🎸
rockin'

20chan 20chan

🎸
rockin'
View GitHub Profile
@tekin
tekin / .gitattributes
Last active February 23, 2024 16:46
An example .gitattributes file that will configure custom hunk header patterns for some common languages and file formats. See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details.
# Stick this in your home directory and point your Global Git config at it by running:
#
# $ git config --global core.attributesfile ~/.gitattributes
#
# See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details
*.c diff=cpp
*.h diff=cpp
*.c++ diff=cpp
*.h++ diff=cpp
@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@icchy
icchy / exp.c
Created September 2, 2019 00:30
Oneline Calc
123;
return 123;
}
extern void *opendir(const char *);
extern void *readdir(void *);
extern void *shmat(int, const void *, int);
typedef struct {
ino_t d_ino;
off_t d_off;
unsigned short d_reclen;
@Farious
Farious / rollback_aab.sh
Last active June 13, 2024 07:39
Script that will use the provided Android App Bundle (.aab) and change its version code and version name to the provided values, avoiding re-building the whole .aab. This enables us to re-submit a previously submited aab to the play store, doing a rollback to the given version.
#!/bin/sh
#
# Script that will use the provided Android App Bundle (.aab) and change its version code and version name to the provided values, avoiding re-building the whole .aab.
# Run this script with: sh rollback.sh your_project.aab android_signing_key.key key_alias key_pwd version_code version_name
#
# Necessary setup:
#
# jarsigner - This binary should exist in the path
#
# Configuration.proto and Resources.proto can be found in aapt2's github
@aholkner
aholkner / SerializedPropertyExtensions.cs
Last active July 17, 2023 13:58
Unity editor extension providing value get/set methods for SerializedProperty. This simplifies writing PropertyDrawers against non-trivial objects.
/* MIT License
Copyright (c) 2022 Alex Holkner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@Zhentar
Zhentar / Description.md
Last active March 1, 2024 04:35
I knew the Span<T> stuff was supposed to be fast, but this is ridiculous!

I have a program that parses data from both delimited files and Excel spreadsheets. I was trying out Span to speed up parsing the delimited files, but the ref struct restrictions mean I can't just hide the two different file formats behind an interface (without the small added overhead of repeatedly pulling Spans from Memory).

But what if I just wrote the ASCII strings from the Excel spreadsheets into a byte buffer, so that the same Span based parser could be used with both file formats? Seems like the overhead cost could be fairly low, and the Excel parsing is already intrinsically slower because of the decompression & XML parsing costs, so I'd be willing to take a small performance hit there for a big gain on the delimited files.

BenchmarkDotNet=v0.10.14, OS=Windows 10.0.17134
Intel Core i7-6600U CPU 2.60GHz (Skylake), 1 CPU, 4 logical and 2 physical cores
.NET Core SDK=2.1.301
[Host] : .NET Core 2.1.1 (CoreCLR 4.6.26606.02, CoreFX 4.6.26606.05), 64bit RyuJIT
@LusainKim
LusainKim / group.cpp
Last active August 27, 2018 07:58
A code that compares multiple cases to a single target.
#include <iostream>
#include <string>
#include <tuple>
using namespace std;
namespace group_compare
{
@Prof9
Prof9 / Readme.md
Last active February 1, 2024 07:02
THIS SCRIPT NO LONGER WORKS! Twitter has rolled out a fix for the web client hack. (Original text: Force enable cramming (280 character tweets) on Twitter. Use TamperMonkey. NOTE: Stops working when you switch pages, refresh to fix.)

As of 7 November 2017 everyone has access to 280 characters in supported clients, so you no longer need this script!

@simnalamburt
simnalamburt / README.md
Last active August 3, 2022 09:50
TypeScript vs Flow
@xnuk
xnuk / hyeong.md
Last active February 11, 2024 15:10
난해한 혀엉.... 언어

이 문서가 여기저기 알려짐에 따라, 이곳에 여러가지 댓글이 달리고 있습니다. 개인적으로는 댓글창을 없애버리고 싶지만 그럴 수 없는 터라, 댓글을 달기 전에 한번씩만 더 생각해주셨으면 합니다.

  • 개인적인 감상은 이곳이 아닌 다른 곳에 적어주세요.
  • 동성애 혐오적인 댓글을 달지 마세요.
  • 기타 "난해한 혀엉... 언어"와 관련없는 댓글을 달지 말아주세요.

위 사항들을 포함해 제 마음에 안 드는 댓글들은 임의로 삭제하고 있습니다. 양해 부탁드립니다.