Skip to content

Instantly share code, notes, and snippets.

View maman's full-sized avatar
🔥

Achmad Mahardi maman

🔥
View GitHub Profile
@maman
maman / sommelier-override.conf
Created February 5, 2024 10:22
ChromeOS fractional scaling
# ~/.config/systemd/user/sommelier\@0.service.d/override.conf
[Service]
Environment="SOMMELIER_SCALE=1.2"
Environment="GDK_SCALE=2"
--- Include/objimpl.h
+++ Include/objimpl.h
@@ -250,7 +250,7 @@
union _gc_head *gc_prev;
Py_ssize_t gc_refs;
} gc;
- double dummy; /* force worst-case alignment */
+ long double dummy; /* force worst-case alignment */
} PyGC_Head;
@import (css)
url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,500;0,600;0,700;1,500;1,600;1,700&display=swap&css");
@maman
maman / repl-server.ts
Last active May 18, 2020 01:15
Deno repl server
import { serve } from "https://deno.land/std@0.50.0/http/server.ts";
const s = serve({ port: 8000 });
console.log('Server online at http://localhost:8000');
for await (const req of s) {
switch(req.url) {
case '/run': {
const {headers, method} = req;
const contentType = headers.get('Content-Type');
if (method === 'POST' && contentType == 'application/javascript') {
const textDecoder = new TextDecoder();
@maman
maman / test.js
Created March 1, 2018 15:10
Trying react new simpleCacheProvider module
const test = async () => {
const { createCache, createResource } = require('./cacheProvider');
function loadUpperCase(text) {
console.log('CALLED!');
return Promise.resolve(text.toUpperCase());
}
function loadUpperCase2(text) {
console.log('CALLED 2!');

Keybase proof

I hereby claim:

  • I am maman on github.
  • I am maman (https://keybase.io/maman) on keybase.
  • I have a public key ASBN5FMoA54ZASa7NWTWp0sHqwkRUxCu66M8SfGcAvTXkgo

To claim this, I am signing this object:

@maman
maman / TTLCacheMap.js
Last active October 5, 2017 03:14
Map implementation with per-record TTL support
class TTLMap {
constructor(TTL) {
this.ttl = TTL;
this.timeoutData = {};
this.data = new Map();
}
_clearTimeout(key) {
clearTimeout(this.timeoutData[key]);
delete this.timeoutData[key];
@maman
maman / better-cnn-lite.user.js
Last active September 16, 2017 03:34
Better experience for CNN Lite website
// ==UserScript==
// @name Better CNN Lite
// @namespace https://github.com/maman
// @version 1.0.0
// @downloadURL https://gist.githubusercontent.com/maman/21288c00d8b53e855604b3acde74e902/raw/better-cnn-lite.user.js
// @match *://lite.cnn.io/*
// ==/UserScript==
/*eslint-disable*/
/* axios v0.16.2 | (c) 2017 by Matt Zabriskie */
-- requires subliminal, version 1.0 or newer
-- default keybinding: b
-- add the following to your input.conf to change the default keybinding:
-- keyname script_binding auto_load_subs
local utils = require 'mp.utils'
function load_sub_fn()
subl = "/usr/local/bin/subliminal" -- use 'which subliminal' to find the path
mp.msg.info("Searching subtitle")
mp.osd_message("Searching subtitle")
t = {}