Skip to content

Instantly share code, notes, and snippets.

View Saren-Arterius's full-sized avatar
💭
(^^)

Saren Arterius Saren-Arterius

💭
(^^)
View GitHub Profile
#!/bin/bash
# Copyright 2018 [email protected]
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#include <stdio.h>
int main(int argc, char const *argv[]) {
int cnt = 2;
for (int i = 1; i < 1000000000; i++) {
cnt += i % 2 == 0 ? -i : i;
}
printf("%d\n", cnt);
return 0;
#!/usr/bin/env python3
from constraint import *
N, magic = 3, 15
# N, magic = 4, 34
sq = N ** 2
def check(*a):
for j in range(N):
#
# Maintainer: Clemens Buchacher <[email protected]>
# Contributor: wangjiezhe <wangjiezhe AT yandex DOT com>
#
# You can use the newpkg script from
# https://github.com/drizzd/octave-forge-archlinux to automatically generate
# new octave-forge PKGBUILDs or update existing ones. Patches welcome.
#
_pack=fuzzy-logic-toolkit
@Saren-Arterius
Saren-Arterius / README.md
Created September 15, 2018 09:20 — forked from lifehome/README.md
Cloudflare API v4 Dynamic DNS Update in Bash

Cloudflare DDNS bash client with systemd

This is a bash script to act as a Cloudflare DDNS client, useful replacement for ddclient.

How to use?

  1. Put the cfupdater files to /usr/local/bin
  • If you are using IPv4 for A record, append -v4 to cfupdater in the following systemd service unit.
  • If you are using IPv6 for AAAA record, append -v6 to cfupdater in the following systemd service unit.
  • If you prefer a dual-stack record, append -dualstack to cfupdater in the following systemd service unit.
  1. chmod +x /usr/local/bin/cfupdater
  2. Create a systemd service unit at /etc/systemd/system/, the cfupdate.service is shown as an example.
8462696833
10086647
6857
1
[71, 839, 1471, 6857]
444444444444444444444444444444444444
148148148148148148148148148148148148
21164021164021164021164021164021164
1924001924001924001924001924001924
148000148000148000148000148000148
@Saren-Arterius
Saren-Arterius / index.html
Created May 14, 2018 13:42 — forked from RubaXa/index.html
String#includes vs. String#indexOf vs. RegExp (http://jsbench.github.io/#a4612afd0cd26e911ee8) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>String#includes vs. String#indexOf vs. RegExp</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
#!/usr/bin/env python3
from time import sleep
CURSOR_UP_ONE = '\x1b[1A'
ERASE_LINE = '\x1b[2K'
def rf():
print(CURSOR_UP_ONE + ERASE_LINE + CURSOR_UP_ONE)
@Saren-Arterius
Saren-Arterius / PKGBUILD
Created April 28, 2018 16:40
anbox lxc 3.0 aur patch
# Maintainer: Iwan Timmer <[email protected]>
pkgname=('anbox-git' 'anbox-modules-dkms-git')
_pkgname=anbox
pkgver=r735.f68725c
pkgrel=1
epoch=1
arch=('x86_64')
url="http://anbox.io/"
license=('GPL3')
@Saren-Arterius
Saren-Arterius / q2-de.py
Last active April 24, 2018 18:51
PolyU OS As
#!/usr/bin/env pypy3
from constraint import *
from collections import Counter
from itertools import combinations
problem = Problem()
requests = [60, 77, 70, 33, 99, 83, 75, 21, 77, 28, 60, 48]
request_l = len(requests)
slots = {
'A': 123,