Skip to content

Instantly share code, notes, and snippets.

View OlivierLi's full-sized avatar
🚀
Making things lean and fast!

Olivier Li OlivierLi

🚀
Making things lean and fast!
View GitHub Profile
//
// main.m
// test_dict
//
// Created by Jessica Munster on 2020-06-05.
// Copyright © 2020 Jessica Munster. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
Sampling process 1374 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling base_unittests (pid 1374) every 1 millisecond
Process: base_unittests [1374]
Path: /Users/USER/Downloads/*/base_unittests
Load Address: 0x1045d4000
Identifier: base_unittests
Version: 0
Code Type: ARM64
Platform: macOS
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static bool modded = false;
uint8_t base_code = keycode & 0x0000FFFF;
if(record->event.pressed){
if(base_code >= KC_A && keycode <= KC_Z){
modded = !modded;
if(!modded){
set_oneshot_mods(MOD_LSFT );
}
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>_SPCommandLineArguments</key>
<array>
<string>/usr/sbin/system_profiler</string>
<string>-nospawn</string>
<string>-xml</string>
#pragma once
// Assumptions:
// 1) Taking a lock is considered costly on the platforms of interest to us,
// even with minimal contention. This is not true on pthread I think.
// 2) Using atomic pointers/indices on the platforms of interest is considered
// cheap. Of course this is not to say that they are free.
// Requirements :
@OlivierLi
OlivierLi / identicos.txt
Created October 12, 2018 16:20
Palabras que son quasi idénticos o idénticos en Frances y Español.
('ADN', 'ADN')
('Alpes', 'Alpes')
('Amsterdam', 'Amsterdam')
('Amsterdam', 'Ámsterdam')
('Angola', 'Angola')
('Arizona', 'Arizona')
('Aruba', 'Aruba')
('Asteraceae', 'Asteraceae')
('Bahamas', 'Bahamas')
('Bahreïn', 'Bahréin')
import json
import sys
import os.path
from shutil import copyfile
from tempfile import mkstemp
import re
import subprocess
# These are simply removed from the overall command.
banned_sub_commands = ['\/nologo ', '\/showIncludes ', 'C:\\\\src\\\\goma\\\\goma-win64\/gomacc.exe ']
template<typename T> │
void merge(T begin, T end, T mid, T scratch_space){ │
auto first{begin}; │
auto second{mid}; │
auto write{scratch_space}; │
#include <iostream>
#include <atomic>
#include <vector>
#include <thread>
// The point of this exercise is to implement a minimal demonstration and then quickly discuss the performance and correctness
// implications of the technique, if any.
// Example for loop unrolling:
@OlivierLi
OlivierLi / map_vs_vec.cpp
Created March 29, 2016 14:51
Map VS Vec
#include <map>
#include <vector>
#include <chrono>
#include <iostream>
#include <algorithm>
bool comp( const std::pair<size_t, size_t>& lhs, const std::pair<size_t, size_t>& rhs ) {return lhs.first < rhs.first; }
int _tmain(int argc, _TCHAR* argv[])
{