Skip to content

Instantly share code, notes, and snippets.

View skalnik's full-sized avatar
🐈

Mike Skalnik skalnik

🐈
View GitHub Profile
total 24
drwxr-xr-x 6 root wheel 204 Jul 20 23:59 .
drwxr-xr-x 107 root wheel 3638 Jul 17 2008 ..
lrwxr-xr-x 1 root wheel 24 Jul 20 23:59 Headers -> Versions/Current/Headers
lrwxr-xr-x 1 root wheel 26 Feb 21 2008 Resources -> Versions/Current/Resources
lrwxr-xr-x 1 root wheel 21 Feb 21 2008 Ruby -> Versions/Current/Ruby
drwxr-xr-x 4 root wheel 136 Feb 21 2008 Versions
total 3160
drwxr-xr-x@ 70 Oompa staff 2380 Jan 20 15:03 .
drwxr-xr-x 5 root admin 170 Aug 29 19:49 ..
-rw-r--r-- 1 Oompa staff 521 Sep 4 22:57 .Business Cart 1.pdf-UjHk
-rw------- 1 Oompa staff 3 Jul 16 2008 .CFUserTextEncoding
-rw-r--r--@ 1 Oompa staff 15364 Jan 20 12:56 .DS_Store
drwxr-xr-x 3 Oompa staff 102 Jan 11 16:34 .DownloadManager
drwx------ 3 Oompa staff 102 Jan 20 11:03 .Trash
-rw------- 1 Oompa staff 80 Jan 12 16:12 .Xauthority
drwxr-xr-x 2 Oompa staff 68 Jul 18 2008 .Xcode
#!/usr/bin/ruby
@LIMIT = 150_000
@is_prime, @omega = Array.new(@LIMIT, false), Array.new(@LIMIT, 0)
def sieve
@is_prime[2] = true
1.step(@LIMIT, 2) { |x| @is_prime[x] = true }
3.step(Math.sqrt(@LIMIT).to_i, 2) do |i|
if @is_prime[i]
(i**2).step(@LIMIT, 2*i) { |x| @is_prime[x] = false }
end
import java.util.*;
public class pr14
{
static HashMap<Integer, Integer> mappy;
public static void main(String[] args)
{
mappy = new HashMap<Integer, Integer>();
for(int i=2; i<1000000; ++i)
{
int l = length(i);
#!/usr/bin/env ruby
if ARGV[0].nil?
puts "Need filename to run"
exit 0
end
basename = File.basename(ARGV[0], '.asm')
lc3as = "/Applications/Simpl.app/lc3as #{ARGV[0]}"
simpl = "/Applications/Simpl.app/Contents/MacOS/simpl #{basename}.obj"
.orig x3000
and R0, R0, #0 ; Counter
ld R7, NMAX ; Negative size of array. This way it can be added to the counter to check if we're done.
lea R6, PRIMES ; Put memory location of array into R6
and R4, R5, #0 ; Always zero.
INIT_LOOP:
add R3, R0, R6 ; Location in the array
str R0, R3, #0 ; Set mem[R3] to counter
$email_message = "<p style=\"color:red;\">Hello World!</p>";
$headers = "From: $email_from\r\n";
$file = $_FILES['file']['tmp_name'];
$file_type = $_FILES['file']['type'];
$file_name = $_FILES['file']['name'];
$f = fopen($file, 'rb');
$raw = fread($f, $_FILES['file']['size']);
#include <stdio.h>
void swap_pointers(int **, int **);
int main() {
int i;
int arr1[] = {1, 2, 3};
int arr2[] = {9, 8, 7, 6};
int *p1 = arr1;
int *p2 = arr2;
#!/usr/bin/env ruby
require 'optparse'
CLOJURE_HOME = '/usr/local/lib'
def e_sh(obj)
case obj
when Array: obj.map{|a| e_sh(a)}
when String: obj.to_s.gsub(/(?=[^a-zA-Z0-9_.\/\-\x7F-\xFF\n])/, '\\').gsub(/\n/, "'\n'").sub(/^$/, "''")
end
end
Updating 3f9869b..8a27242
Fast forward
app/controllers/agents_controller.rb | 9 +-
app/controllers/application_controller.rb | 2 +-
app/controllers/buy_controller.rb | 112 ++++++----------
app/controllers/clients_controller.rb | 83 +++++++++++-
app/controllers/interviewees_controller.rb | 24 ++--
app/controllers/options_controller.rb | 6 +-
app/controllers/sessions_controller.rb | 4 +-
app/controllers/statistics_controller.rb | 21 +++