Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@walac
walac / build_dali.bat
Last active November 10, 2020 19:56
Build DALi on Windows
set base_dir=c:\work
set common_args=-g "Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=%base_dir%\dali-env -DCMAKE_TOOLCHAIN_FILE=%base_dir%\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_DEBUG=ON -Wno-dev
REM dali-core
cd %base_dir%\dali-core\build\tizen
rd /Q /S build-windows
mkdir build-windows
cd build-windows
cmake %common_args% -DENABLE_PKG_CONFIGURE=OFF -DENABLE_LINK_TEST=OFF -DINSTALL_CMAKE_MODULES=ON .. || goto :error
cmake --build . --target install || goto :error
@walac
walac / build_dali.sh
Last active October 15, 2020 20:16
Build DALi on macOS
#!/bin/bash -vex
base_dir=$HOME/work
source $base_dir/setenv
common_args="-DCMAKE_INSTALL_PREFIX=$DESKTOP_PREFIX \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-Wno-dev \
@walac
walac / order.cpp
Last active August 24, 2020 20:35
#include <set>
#include <cassert>
#include <optional>
#include <algorithm>
#include <unordered_map>
struct Order {
using id_type = uint64_t;
enum Side {
#include <map>
#include <limits>
#include <random>
#include <iostream>
#include <cstdlib>
template<typename K, typename V>
class interval_map {
std::map<K,V> m_map;
#!/usr/bin/env python3
import boto3
import datetime
import statistics
import itertools
import jinja2
import os
list_of_templates = [
#!/bin/bash -ex
projectid=$(gcloud config list --format 'value(core.project)' 2> /dev/null)
auth_account=taskcluster-auth-token-creator
sa_suffix='iam.gserviceaccount.com'
create_service_account() {
name=$1
if ! gcloud beta iam service-accounts list | grep $name; then
gcloud beta iam service-accounts create $name --display-name $name || true
import os
import sys
from datetime import datetime
import psycopg2
import pytz
lower = int(sys.argv[1])
upper = int(sys.argv[2])
@walac
walac / asm.sh
Created March 22, 2017 15:37
Generate the assembly code for firefox binaries
!/bin/bash
set -euxv
mount() {
hdiutil attach -noautofsck -mountpoint $2 $1 \
| tail -1 \
| awk '{print substr($0, index($0,$3))}'
}

Keybase proof

I hereby claim:

  • I am walac on github.
  • I am wcosta (https://keybase.io/wcosta) on keybase.
  • I have a public key whose fingerprint is B048 41AE 800C 1BF0 1FE1 BC3D 084C 5584 542E 1574

To claim this, I am signing this object: