Skip to content

Instantly share code, notes, and snippets.

agum onkey agumonkey

  • NONE
  • Dark side of the moon @ ['tkf8-2-1', 'ay21-3', '3263-827']
Block or report user

Report or block agumonkey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MetaObject.php
<?php
namespace CHH;
trait MetaObject
{
protected static $__metaClass;
static function setMetaClass(MetaClass $metaClass)
{
View try.rackunit.rkt
(require rackunit)
(require rackunit/text-ui)
(define q1
(test-suite
"question 1 : warm up, project, inverse"
(check-equal? 1000 (* 10 10 10) "trivial equality")
(check-exn exn:fail? (lambda () (error "DUCK!"))) "test for function that should fail"))
(run-tests q1)
View array push aliasing.rb
irb(main):001:0> a = [1,2,3]
irb(main):001:0> a = [1,2,3]
=> [1, 2, 3]
irb(main):002:0> b = a << 4
b = a << 4
=> [1, 2, 3, 4]
irb(main):003:0> a
a
=> [1, 2, 3, 4]
@agumonkey
agumonkey / cprv.py
Last active Dec 15, 2015
tired of my bash/zsh misunderstandings, wrote a magnificent `cp -Rv` in python.
View cprv.py
import os
import subprocess
def cmd(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
return iter(p.stdout.readline, b'')
def pre(path):
View coursera.grader.el
(require 'dash)
(defvar *hw/percent* 0.9)
(defvar *pr/percent* 0.1)
(defvar *week/percent* 0.1)
(defvar *exam/percent* 0.15)
(defun weekly-grades (hp)
(let ((hw (car hp))
(pr (cdr hp)))
@agumonkey
agumonkey / browse-kill-ring.el
Last active Dec 15, 2015
browse-kill-ring augmented with "!" key to trim [[:blank:]]~ items
View browse-kill-ring.el
;;; browse-kill-ring.el --- interactively insert items from kill-ring -*- coding: utf-8 -*-
;; Copyright (C) 2001, 2002 Colin Walters <walters@verbum.org>
;; Author: Colin Walters <walters@verbum.org>
;; Maintainer: Nick Hurley <hurley@cis.ohio-state.edu>
;; Created: 7 Apr 2001
;; Version: 1.3a (CVS)
;; X-RCS: $Id: browse-kill-ring.el,v 1.2 2008/10/29 00:23:00 hurley Exp $
;; URL: http://freedom.cis.ohio-state.edu/~hurley/
View mysum.rb
class Object
def mysum
0
end
end
class Fixnum # The class belonging to small integers
def mysum
self # The sum of an integer is just itself
end
View philo.el
(progn
(message ":package")
(require 'package)
(add-to-list 'package-archives
'("marmalade" .
"http://marmalade-repo.org/packages/"))
(package-initialize)
(package-refresh-contents))
;;; ...
View mega.co.nz.upload.monitor.js
// table -> [dom]
var lines = jQuery("#gridview-1035 table tr");
// [dom] -> [str]
var parse = function (i,e) {
var s = e.textContent.split(" ");
return s[0] ? s[0].trim() : null; // if (s[0]) { return s[0].trim(); } else return null;
};
files = lines.map(parse);
View is-it-paredit-wrap-bug.el
;;; caret located "wat"
(message "wat")
(defun wat ()
.|. "wat")
;;; C-( should? wrap "wat" but eats the previous s-exp
((message "wat")
defun wat ()
"wat")
You can’t perform that action at this time.