Skip to content

Instantly share code, notes, and snippets.

View shelling's full-sized avatar

shelling shelling

View GitHub Profile
import { readFileSync } from 'fs'
import OpenAI from 'openai';
import { ChatCompletionMessageParam } from 'openai/resources/chat';
import inquirer from 'inquirer';
import input from '@inquirer/input';
import {
Product,
@shelling
shelling / sources.list
Created November 5, 2010 07:09
apt repository list for Linux Mint
deb http://packages.linuxmint.com/ isadora main upstream import
deb http://archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ lucid partner
deb http://packages.medibuntu.org/ lucid free non-free
deb http://dl.google.com/linux/deb/ stable non-free
deb http://tw.archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse
deb http://debian.nctu.edu.tw/ubuntu/ lucid main restricted universe multiverse
@shelling
shelling / example-preseed.txt
Created August 17, 2010 05:48
Debian Preseed Example
#### Contents of the preconfiguration file (for lenny)
### Localization
# Locale sets language and country.
d-i debian-installer/locale string en_US.UTF-8
# Keyboard selection.
#d-i console-tools/archs select at
d-i console-keymaps-at/keymap select us
# Example for a different keyboard architecture
#d-i console-keymaps-usb/keymap select mac-usb-us
@shelling
shelling / gtkrc
Created November 5, 2010 07:01
key-binding of emacs style in gnome
# GTK - The GIMP Toolkit
# Copyright (C) 2002 Owen Taylor
#
# 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 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@shelling
shelling / Makefile
Created October 20, 2010 11:50
Matlab launcher on Gnome
.PHONY: all
all:
mv matlab.png /usr/share/icons/hicolor/256x256/apps/
mv matlab.desktop /usr/share/applications/
echo alias matlab=\'matlab -nodisplay\' >> /etc/bash.bashrc
update-menus
@shelling
shelling / foreach.el
Created April 12, 2011 05:48
foreach in elisp
#!/usr/bin/env emacs --script
(require 'cl)
(defun foreach (alist func)
(while alist
(progn
(funcall func (car alist))
(setq alist (cdr alist)))
))
var Func = function(e) {
"use strict";
var a, t = $("#ECPayPayment"),
n = e.sdkVersion,
c = e.token,
i = e.language,
d = e.cliPriKey,
r = e.serPubKey,
s = e.keyID,
p = e.uuid,
@shelling
shelling / lwpex.pl
Created August 23, 2009 14:58
using LWP with HTTP Basic Authentication
#!/usr/bin/env perl
use LWP::UserAgent;
use HTTP::Request;
use UNIVERSAL::dump;
use XML::Simple;
use Data::Dumper;
use YAML qw(LoadFile);
$config = LoadFile "$ENV{HOME}/.posterous";
class Singleton(object):
def __new__(cls):
if not cls.singleton:
cls.singleton = object.__new__(cls)
return cls.singleton
class Foo(Singleton):
singleton = None
pass
class Hooks(object):
@staticmethod
def before(name):
def decorator(func):
def wrap(self, *args):
self.__getattribute__(name)()
func(self, *args)
return wrap
return decorator