Skip to content

Instantly share code, notes, and snippets.

View peccu's full-sized avatar
🦉
Information is the network

peccu peccu

🦉
Information is the network
View GitHub Profile
@peccu
peccu / TurnipPrices.cpp
Last active May 11, 2020 00:42 — forked from Treeki/TurnipPrices.cpp
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@peccu
peccu / hubotify.ros
Last active June 6, 2017 03:12 — forked from fukamachi/hubotify.ros
Generate a Hubot script (.js file) from the given Roswell script.
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
#|
Generate a Hubot script (.js file) from the given Roswell script.
Usage:
$ hubotify <roswell script>
@peccu
peccu / README.org
Last active February 26, 2023 17:46 — forked from codebycliff/ReadingList
AppleScript command for adding entry to safari reading list.

Add to Reading List from Command

Install

Add contents of ReadingList.sh to .bashrc or .zshrc etc.

Usage

atrl URL

Example

atrl http://google.com

@peccu
peccu / clhs.ros
Last active November 7, 2016 03:02 — forked from fukamachi/clhs.ros
A Roswell script for opening HyperSpec page describing a given symbol in the default browser.
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
#|
A Roswell script to open the HyperSpec page of a specified symbol in the default browser.
@peccu
peccu / freenom.com.ddns.sh
Created May 14, 2016 03:00 — forked from kampro/freenom.com.ddns.sh
Dynamic DNS support shell script for freenom.com
#!/bin/bash
# settings
# Login information of freenom.com
freenom_email="main@address"
freenom_passwd="pswd"
# Open DNS management page in your browser.
# URL vs settings:
# https://my.freenom.com/clientarea.php?managedns={freenom_domain_name}&domainid={freenom_domain_id}
freenom_domain_name="domain.name"
@peccu
peccu / ng-really.js
Last active February 11, 2018 13:42 — forked from asafge/ng-really.js
/**
* A generic confirmation for risky actions.
* Usage: Add attributes: ng-really-message="Are you sure?" ng-really-click="takeAction()" ng-really-cancel-click="cancelAction()" function
*/
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;
;; This function is quoted from this page. Thanks to Tomohiro Matsuyama.
;; http://dev.ariel-networks.com/Members/matsuyama/pretty-lambda-in-emacs/
(defun set-pretty-patterns (patterns)
(loop for (glyph . pairs) in patterns do
(loop for (regexp . major-modes) in pairs do
(loop for major-mode in major-modes do
(let ((major-mode (intern (concat (symbol-name major-mode) "-mode")))
(n (if (string-match "\\\\([^?]" regexp) 1 0)))
(font-lock-add-keywords major-mode
`((,regexp (0 (prog1 ()
@peccu
peccu / common.css
Created May 20, 2012 04:43 — forked from takumikinjo/.gitignore
HTML5 Presentation export for Org-mode
#speaker-note {
position:absolute;
left: 0;
top: 80%;
width: 100%;
height: 20%;
z-index: 8;
opacity: 0.75;
background-color: white;
overflow: auto;
@peccu
peccu / anything-org-mode.el
Created January 11, 2012 17:57
anything-org-mode.el
(defun anything-org-todo-list (arg)
(interactive "P")
(org-compile-prefix-format 'todo)
(org-set-sorting-strategy 'todo)
;;(org-prepare-agenda "TODO")
(if (and (stringp arg) (not (string-match "\\S-" arg))) (setq arg nil))
(let* ((today (time-to-days (current-time)))
(date (calendar-gregorian-from-absolute today))
(kwds org-todo-keywords-for-agenda)
(completion-ignore-case t)
@peccu
peccu / dict.m
Created January 6, 2012 07:42 — forked from hitode909/dict.py
非同期に辞書を引く
// copy from https://gist.github.com/1203094
// gcc -o dict -Wall -fobjc-gc -O2 -std=c99 dict.m -framework carbon -framework cocoa
#import <Cocoa/Cocoa.h>
#import <CoreServices/CoreServices.h>
int main(int argc, char *argv[])
{
NSString *word;
NSString *result;