Skip to content

Instantly share code, notes, and snippets.

@kddnewton
kddnewton / json.rb
Last active October 6, 2023 09:25
JSON parser with pattern matching
require "json"
struct = { "a" => 1, "b" => 2, "c" => [1, 2, 3], "d" => [{ "e" => 3 }, nil, false, true, [], {}] }
source = JSON.dump(struct)
tokens = []
index = 0
until source.empty?
tokens <<
@iximeow
iximeow / stub.rs
Created January 30, 2022 00:21
glue between nasm and exec
use std::io::Write;
use std::process::Command;
extern "C" {
fn mprotect(addr: *const u8, len: usize, prot: u32) -> u32;
}
fn main() {
let mut args = std::env::args();
let _ = args.next();
@roktas
roktas / README.md
Last active November 19, 2021 04:26
Ruby için minimal VS Code yapılandırması

Verilen yapılandırma ayarlarını yapılandırmanıza uygulamak için mevcut VS Code yapılandırma dosyasını (settings.json) açın

  • Menüden "Görünüm → Komut Paletini" seçin

  • Open Settings (JSON) girin

Yapılandırma dosyası açıldığında ekte verilen yapılandırmayı kopyala yapıştır yoluyla (kısmen veya tamamen) aktarın

  • Yapılandırma tüm dosya halinde verilmiştir
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
wget -O /tmp/YaHei.Consolas.1.12.zip https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/uigroupcode/YaHei.Consolas.1.12.zip
unzip /tmp/YaHei.Consolas.1.12.zip
sudo mkdir -p /usr/share/fonts/consolas
sudo mv YaHei.Consolas.1.12.ttf /usr/share/fonts/consolas/
sudo chmod 644 /usr/share/fonts/consolas/YaHei.Consolas.1.12.ttf
cd /usr/share/fonts/consolas
sudo mkfontscale && sudo mkfontdir && sudo fc-cache -fv
@roktas
roktas / Vagrantfile
Last active June 18, 2018 08:23
bcyrpt
Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu/bionic64'
config.vm.provision 'shell', privileged: false, inline: <<-SHELL
DEBIAN_FRONTEND=noninteractive sudo -E apt-get -y update
DEBIAN_FRONTEND=noninteractive sudo -E apt-get install -y slapd
DEBIAN_FRONTEND=noninteractive sudo -E apt-get install -y --no-install-recommends ruby-full build-essential
sudo gem install bcrypt
sudo tar -xf /vagrant/*.tar.gz -C /
@noelbundick
noelbundick / LICENSE
Last active April 11, 2024 16:12
Exclude WSL installations from Windows Defender realtime protection
MIT License
Copyright (c) 2018 Noel Bundick
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:
@poy
poy / subcommands.go
Last active February 27, 2023 06:02
Simple Subcommands in Go
package subcommands
import (
"fmt"
"log"
"os"
"strings"
)
type Command interface {

MacBook Pro 13 Retina Debian Kurulumu

Disk bölümlendirmesi

  1. "Disk İzlencesi" kullanılır

  2. "Apple SSD" diski olası hatalara karşı öncelikle onarılmalıdır

  • "İlk yardım" menüsü ile onarım yapılır