Skip to content

Instantly share code, notes, and snippets.

View 1ay1's full-sized avatar
🎯
Focusing

ayu 1ay1

🎯
Focusing
  • Remote
View GitHub Profile
@1ay1
1ay1 / build.prop
Created December 1, 2015 06:24 — forked from CHEF-KOCH/build.prop
Android Build.prop tweaks <- FOR ALL AOSP ROMS (4.0.x - 5.0.x) ->
# Begin build properties
# EOL UNIX
# 0.0 644 /system/build.prop
#
# Note: Some changes are Device and OS/ROM independent!
# Note2: Some settings are between
# performance and security <- I prefer last one
#
ro.build.id= -----
ro.build.display.id= -----
@1ay1
1ay1 / CMakeLists.txt
Created September 9, 2020 06:23 — forked from fracek/CMakeLists.txt
CMake and GTK+ 3
# Set the name and the supported language of the project
PROJECT(hello-world C)
# Set the minimum version of cmake required to build this project
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
# Use the package PkgConfig to detect GTK+ headers/library files
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(GTK3 REQUIRED gtk+-3.0)
# Setup CMake to use GTK+, tell the compiler where to look for headers
@1ay1
1ay1 / get_posts.js
Last active February 7, 2022 09:10
// user_id -> int ; post_ids -> []
function get_posts(user_id, post_ids) {
//usually we will just use an ORM here
let post_ids_str = "(";
//serialize the post_ids for the query
post_ids.map(val => {
post_ids_str += `${val.toString()}, `;
})
post_ids_str += ")";
// def merge_posts(list_of_posts: List[List[Post]]) -> List[Post]
function merge_posts(list_of_posts) {
let posts = [];
list_of_posts.map(val => {
posts.concat(val);
});
//only uniques
posts = posts.filter((val, index) => posts.indexOf(val) === index);