Skip to content

Instantly share code, notes, and snippets.

View copremesis's full-sized avatar

Robert Ortiz copremesis

View GitHub Profile
@copremesis
copremesis / octokit.js
Created October 19, 2023 18:39
automating the use of gist
// Octokit.js
// https://github.com/octokit/core.js#readme
//import fetch from 'node-fetch';
//import { Octokit, App } from "octokit";
const fetch = require('node-fetch-commonjs');
import { Octokit } from '@octokit/rest';
const octokit = new Octokit({
request: {
@copremesis
copremesis / OSX Secure Disk Wipe.md
Last active August 13, 2020 04:08 — forked from joeblau/OSX Secure Disk Wipe.md
Securely erase an external disk using dd on OSX

Securely erase an external disk using dd on OSX

  1. Plug in your SD card, HDD, or other block device and then use the following command to see which /dev/diskN node it's located on:
diskutil list
  1. Unmount the disk where N is the number of the disk taken from the above command:
@copremesis
copremesis / ror.md
Last active October 15, 2020 22:14
Challenge

Ruby on Rails Challenge

Overview

Using Ruby on Rails, we'd like you to create a simple experts directory search tool.

  • Spend, at max, 4 hours on this project.

Ember Starter Template

Starter template which includes libraries for bootstrap (Yeti theme), ember.js + ember-data

A Pen by Curt Husting on CodePen.

License.

Keybase proof

I hereby claim:

  • I am copremesis on github.
  • I am copremesis (https://keybase.io/copremesis) on keybase.
  • I have a public key ASCLauGH_ixCE72rbQ5cnTrEQBHB2XNcD_vbv86lOjOjNgo

To claim this, I am signing this object:

@copremesis
copremesis / node-and-npm-in-30-seconds.sh
Created February 23, 2016 20:22 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
# Represent states such as 'active', 'disabled', etc in the DB as an int
#
# Use like so:
#
# class MyModel < ActiveRecord::Base
# include StuffedTableColumns
# stuffed_column :status, *(%w(active inactive blocked disabled banned))
# end
# TODO: use method_missing to match the column name
@copremesis
copremesis / date_range.rb
Created November 7, 2012 22:57
Sometimes abstraction kills performance
require 'benchmark'
Object.send(:remove_const, :DateRange)
class DateRange < Struct.new(:start_date, :end_date)
def good_include?(date)
(start_date..end_date).cover?(date)
end
def other_include?(date)
(date >= start_date && date <= end_date)
end
end