Skip to content

Instantly share code, notes, and snippets.

Avatar

Dimiter 'malkia' Stanev malkia

View GitHub Profile
@jifalops
jifalops / _README.md
Last active Jun 30, 2019
Headless Crostini quick setup script for Flutter, VS Code, Node/npm (via nvm), Firebase tools, and pip for Python3
View _README.md

Headless Crostini quick setup script for Flutter, VS Code, Node/npm (via nvm), Firebase tools, and pip for Python3

Modify lines 20 and 21 with your gist and token for the VS Code settings-sync extension.

The script adds a symbolic link to the ChromeOS Downloads folder at ~/Downloads. For it to work, share your Downloads folder with Linux by right-clicking it in the Files app.

WARNING

  • The script appends to the PATH environment variable each time it runs (at the end).
  • settings.json for VS Code will be overwritten if it exists! (The default settings are empty and it was easier to do it this way than to use jq.)
@binshengliu
binshengliu / install-clang-8-debian.sh
Created May 14, 2019
Install Clang-8 on Debian Stretch
View install-clang-8-debian.sh
sudo echo -e 'deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-8 main\ndeb-src http://apt.llvm.org/stretch/ llvm-toolchain-stretch-8 main\n' >> /etc/apt/sources.list
sudo aptitude install clang-8 clang-tools-8 clang-format-8
sudo aptitude install libc++-8-dev libclang-8-dev libc++abi-8-dev
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-8 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-8 100
sudo update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-8 100
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-8 100
@ajinasokan
ajinasokan / flutter_desktop_macos.md
Last active Nov 22, 2019
Run Flutter apps in MacOS with IDE support and hot reloading
View flutter_desktop_macos.md

This setup is only for MacOS. I don't have a windows/linux machine to test.

Clone FDE repo

cd ~
git clone https://github.com/google/flutter-desktop-embedding

Switch to flutter master

@DavidBuchanan314
DavidBuchanan314 / cursed_mandelbrot.c
Last active Jan 12, 2022
Compile-time mandelbrot in pure C. Outputs a PGM image file to stdout. Output can be seen at https://twitter.com/David3141593/status/1062468528115200001
View cursed_mandelbrot.c
#include <stdio.h>
#define SQ(x) (x)*(x)
#define M0(x,y) SQ(x)+SQ(y)<4?0:0xe0
#define M1(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M0(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0)):0xc0
#define M2(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M1(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0xa0
#define M3(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M2(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x80
#define M4(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M3(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x60
#define M5(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M4(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x40
@bzub
bzub / 20180819-crostini_sommelier_fix.md
Last active Jul 24, 2021
Fix Crostini Wayland/X (sommelier) service
View 20180819-crostini_sommelier_fix.md

If you can't get X11 or Wayland GUI Linux apps to start anymore on Chrome OS, try the following.

In the Terminal app, this will show the status of your systemd user services/units:

systemctl --user

If sommelier@0.service and sommelier-x@0.service show a failed status, the following worked for me:

sudo ln -s /opt/google/cros-containers/bin/sommelier.elf /usr/bin/
@mattifestation
mattifestation / SysmonEventGUIDParser.ps1
Last active Jun 19, 2022
Extracts fields from sysmon process and logon GUIDs
View SysmonEventGUIDParser.ps1
# Author: Matthew Graeber (@mattifestation)
$Epoch = Get-Date '01/01/1970'
# Conversion trick taken from https://blogs.technet.microsoft.com/heyscriptingguy/2017/02/01/powertip-convert-from-utc-to-my-local-time-zone/
$StrCurrentTimeZone = (Get-WmiObject Win32_timezone).StandardName
$TZ = [TimeZoneInfo]::FindSystemTimeZoneById($StrCurrentTimeZone)
# Parse out all the LogonGUID fields for sysmon ProcessCreate events
Get-WinEvent -FilterHashtable @{ LogName = 'Microsoft-Windows-Sysmon/Operational'; Id = 1 } | ForEach-Object {
@jart
jart / blakefiler.py
Last active Jan 3, 2022
Turns bazel query --output=build //tensorflow:libtensorflow_framework.so into isomorphic Makefile
View blakefiler.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@chinmaygarde
chinmaygarde / FlutterEmbedderGLFW.cc
Last active Mar 25, 2022
Flutter Embedder API Example (GLFW with OpenGL)
View FlutterEmbedderGLFW.cc
#include <assert.h>
#include <chrono>
#include <embedder.h>
#include <glfw3.h>
#include <iostream>
static_assert(FLUTTER_ENGINE_VERSION == 1, "");
static const size_t kInitialWindowWidth = 800;
@martinwicke
martinwicke / automobile.ipynb
Last active Jan 9, 2022
Estimator demo using Automobile dataset
View automobile.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.