Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/env bash
if pidof sway >/dev/null 2>&1; then
echo 'sway is already running. exiting.' >&2
exit 1
fi
readonly XDG_CONFIG_HOME="$HOME/.config"
readonly LOG_FILE="$XDG_CONFIG_HOME/sway/log"
@syphoxy
syphoxy / flutter.nix
Created July 25, 2022 05:43
Flutter Nix shell configuration file that provides dependencies for both Android and Linux build targets
# Flutter: 2.10.1->3.0.4 <https://github.com/NixOS/nixpkgs/pull/173200>
# 043de04db8a6b0391b3fefaaade160514d866946 used below refers to latest commit on PR #173200.
{
pkgs ? import (fetchTarball "https://github.com/nixos/nixpkgs/archive/043de04db8a6b0391b3fefaaade160514d866946.tar.gz") {},
android-nixpkgs ? import (fetchTarball "https://github.com/tadfisher/android-nixpkgs/archive/master.tar.gz") {}
}:
let
android-sdk = android-nixpkgs.sdk (sdkPkgs: with sdkPkgs; [
tools
emulator
package main
import (
"encoding/xml"
"fmt"
"log"
"os"
"sort"
"github.com/ikawaha/kagome/tokenizer"
@syphoxy
syphoxy / main.go
Created December 24, 2019 05:51
nhk-radio-helper
package main
import (
"encoding/xml"
"errors"
"log"
"net/http"
"os"
"os/exec"
"strings"
@syphoxy
syphoxy / reminder.lua
Created March 8, 2018 01:17
small script that sets up a 10 minute reminder to keep hydrated
-- ~/.config/awesome/rc.lua
gears.timer {
timeout = 60 * 10,
autostart = true,
callback = function ()
naughty.notify {
title = "Reminder!",
text = "Have you drank water recently?",
}
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"io"
"log"
"net"
#!/bin/bash
readonly TERMINAL="${TERMINAL:-urxvt256c-ml}"
readonly EDITOR="${EDITOR:-vim}"
readonly FILE="$(mktemp)"
cleanup() {
test -f "$FILE" \
&& rm -f "$FILE"
function scss-compile {
scss --compass -q \
"skin/frontend/enterprise/$1/scss/$1.scss" \
"skin/frontend/enterprise/$1/css/$1.css" \
&& echo "Compile succeeded!" \
|| echo "Compile failed!"
}
function scss-compile-debug {
scss --compass -g -l -t expanded \
<?php
define('RELAY_HOST', '127.0.0.1');
define('RELAY_PORT', 4545);
define('APP_TOKEN', 'REMOVED');
header('Content-type: application/json');
if (!isset($_REQUEST['token']) || $_REQUEST['token'] !== APP_TOKEN) {
echo json_encode(array(
@syphoxy
syphoxy / person.c
Created June 2, 2014 14:41
experimental object creation and validation in C
#include <stdlib.h>
#include <stdio.h>
#define PERSON_NAME_UNSET 0x0001
#define PERSON_GROUPS_UNSET 0x0002
typedef struct collection_t {
void **items;
int count;
int available;