Skip to content

Instantly share code, notes, and snippets.

(import '(java.awt Point Graphics Frame) '(java.awt.geom AffineTransform))
(def minpoint (doto (Point.) (.setLocation 0 0)))
(def maxpoint (doto (Point.) (.setLocation 1000 1000)))
(defn draw [pts #^Frame w]
(doseq [[x y] pts] (.fillRect (.getGraphics w) x y 1 1)))
(let [w (doto (Frame. "Bitmap") (.setSize 600 700) (.setVisible true))] ())
@maxsu
maxsu / ggg.pl
Created July 21, 2013 10:23 — forked from avar/ggg.pl
#!/usr/bin/env perl
use v5.10;
use warnings FATAL => "all";
use Dancer;
use URI::Escape qw(uri_escape_utf8);
# This is all the search engine does
get '/search' => sub {
given (param("q")) {
when (/^(?:!(?:ducky)?\s+|\\)(.*)/) { redirect 'http://www.google.com/search?btnI=1&q=' . uri_escape_utf8 $1 }

Working With Github Pages

The FAQ maintained by Github covers most stumbling blocks, some other tips and tricks supplied here.

Gitignore

Add _site to .gitignore. The generated site should not be uploaded to Github since its gets generated by github.

Working With Code Partials

@maxsu
maxsu / download_apk.py
Created August 9, 2021 19:07 — forked from dawand/download_apk.py
Download APK files from Google Play Store with Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File name: download_apk.py
Author: Dawand Sulaiman
Download APK files from Google Play Store with Python
This script scraps https://apkpure.com to get the apk download link
Make sure you have BeautifulSoup and urllib libraries
"""
import tqdm
import json
# states:
# neutral: 0
# player1: 1, 2, 3 (have 2 of each)
# player2: -1, -2, -3 (have 2 of each)
# board: 3x3 => 9 long tuple (board[i][j] = tuple[i*3 + j])
# Rotations
@maxsu
maxsu / hotspot.cmd
Last active April 1, 2023 22:04 — forked from primaryobjects/hotspot-keep-alive.ps1
Script to Enable Windows 10 Mobile Hotspot Automatically After Reboot
PowerShell -Command "Set-ExecutionPolicy Unrestricted" >> "%TEMP%\StartupLog.txt" 2>&1
PowerShell C:\Users\YOUR_USERNAME\Desktop\hotspot.ps1 >> "%TEMP%\StartupLog.txt" 2>&1