Skip to content

Instantly share code, notes, and snippets.

Scott Noel-Hemming frogstarr78

Block or report user

Report or block frogstarr78

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 WHM.php.patch
62,66c62,68
< $cacheObj = json_decode($cacheFile);
< if(isset($cacheObj->$user)){
< return $cacheObj->$user;
< }else{
< throw new Exception("User does not exist in cache_keys. Try regenerating the cache.");
---
> if ( $cacheFile ) {
> $cacheObj = json_decode($cacheFile);
> if(isset($cacheObj->$user)){
@frogstarr78
frogstarr78 / open.py
Created Nov 10, 2015 — forked from thiago-vieira/open.py
natural open struct in python
View open.py
class Class:
pass
x = Class()
x.something = 42
print(x.something) # 42
@frogstarr78
frogstarr78 / Benchmark.rb
Created May 6, 2010
Attempt to use ruby to generate some functional constructs.
View Benchmark.rb
require 'benchmark'
require 'Functional'
Benchmark.bmbm 30 do |bm|
f = Functional.new
bm.report( "define fib 1" ) { f.define( :fib, 1 ) { 1 } }
bm.report( "define fib 2" ) { f.define( :fib, 2 ) { 1 } }
bm.report( "define fib Fixnum" ) { f.define( :fib, Fixnum ) {|n| fib(n-1) + fib(n-2) } }
@frogstarr78
frogstarr78 / git-spawn-repo-from-commit_hash
Created Apr 23, 2010
Start a new repository based on the commit hash of another repository
View git-spawn-repo-from-commit_hash
#!/bin/bash
# Copyright (c) 2009 Frogstarr78 Software
#
# 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
@frogstarr78
frogstarr78 / MethodsLikeSmalltalkConditionals.rb
Created Apr 10, 2010
Ruby Methods emulating Smalltalk Conditionals
View MethodsLikeSmalltalkConditionals.rb
module MethodsLikeSmalltalkConditionals
module Kernel
def is_true
Proc.new { yield }
end
def is_false
Proc.new { yield }
end
end
@frogstarr78
frogstarr78 / HashLikeSmallTalkConditionals.rb
Created Apr 10, 2010
Ruby Hashes emulating Smalltalk Conditionals
View HashLikeSmallTalkConditionals.rb
#!/usr/bin/env ruby
module HashLikeSmalltalkConditionals
class ::Object
def nil? hash
hash[:if_false].call
self
end
end
You can’t perform that action at this time.