Skip to content

Instantly share code, notes, and snippets.

View maliqq's full-sized avatar
🚀
productive

maliqq

🚀
productive
View GitHub Profile
@maliqq
maliqq / bishkek.dsl
Last active November 18, 2026 00:47
DSL syntax for Bishkek streets topology
// Bishkek road source.
// Schematic, north up; 100 x 100 grid, 3-point outer padding, no pinned center.
// road[*N] Name DIR [#rgb] DIR = N, S, E, W, NW ... (two-way)
// road[*N] Name A->B or A<-B [#rgb] arrow = one-way flow
// boulevard[*N] ... same, is a boulevard
// ∞ around DIR opens ends: ∞N, N∞, ∞N∞
// Name [ARM|~NW] [(o)] [@(lat, lng)] indented bare name = terminating join
// x/xv/x^ Name [ARM|~NW] [·|·N] [(o)] [@(lat, lng)]
// % Name: A -> B [*N] [boulevard] · % Name: A -> B as Alternate Name · !! Name: A -> B
// @ Name [*N] · boulevard[*N] Name[: A -> B] (boulevard style or section)
@maliqq
maliqq / deploy-rails.yml
Created June 25, 2026 21:16
deploy Rails via Ansible (Capistrano-style directory structure)
---
- name: Deploy Rails application
hosts: "{{ deploy_hosts | default('staging') }}"
become: true
vars:
app_name: rails_app
deploy_user: deploy
deploy_to: "/var/www/{{ app_name }}"
repo_url: ""
/*
* Kitchen Pomodoro Timer — Arduino Nano (3-Button Version)
*
* Hardware:
* - 4-digit 7-segment LED display (TM1637) → CLK=D2, DIO=D3
* - Piezo buzzer → D8
* - BTN_M (Mode) → D4 (INPUT_PULLUP)
* - BTN_PLUS (+) → D5 (INPUT_PULLUP)
* - BTN_MINUS (−) → D6 (INPUT_PULLUP)
*
const int pins[] = {8, 2, 3, 4, 5, 6, 7, 9, 10};
const int count = sizeof(pins) / sizeof(pins[0]);
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("booted");
for (int i = 0; i < count; i++) {
pinMode(pins[i], OUTPUT);
const int buzzerPin = 9; // Assign the buzzer to digital pin 9
void setup() {
pinMode(buzzerPin, OUTPUT); // Set the buzzer pin as an output
}
void loop() {
tone(buzzerPin, 1000); // Send a 1KHz sound signal
delay(1000); // Pause for 1 second
noTone(buzzerPin); // Stop the sound signal
// A B C D E F G DP
// 6 5 2 3 4 7 8 9
int pins[] = {6, 5, 2, 3, 4, 7, 8, 9};
char segments[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'D','P'};
const int NUM_PINS = 8;
void setup() {
for (int i = 0; i < NUM_PINS; i++) {
pinMode(pins[i], OUTPUT);
@maliqq
maliqq / StateMonad.scala
Created December 2, 2016 02:42 — forked from channingwalton/StateMonad.scala
State Monad and Validation with Scalaz
import scalaz._
import Scalaz._
/**
* Use the state monad to 'process a trade' and store the new trade.
* As well as processing the trade, handle validation errors.
*/
object StateMonad extends App {
case class Trade(info: String)
package main
import "bytes"
import "io"
import "os"
import "strings"
import "strconv"
import "fmt"
import "flag"
import "net/http"
// Copyright (C) 2012 Benoit Sigoure
// Copyright (C) 2012 StumbleUpon, Inc.
// This library is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 2.1 of the License, or (at your
// option) any later version. This program is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
// General Public License for more details. You should have received a copy
// of the GNU Lesser General Public License along with this program. If not,
{
"situation":"open_raise",
"position":null,
"upload_hands_item_id":"526ed331ce34de6612a66390",
"created_at":"2013-10-29T01:12:17.178Z",
"updated_at":"2013-10-29T01:12:17.178Z",
"upload_hands_item_date":"2013-10-29T01:12:17.178Z",
"columns":[
{
"aposteriori_share":"0.33282",