Skip to content

Instantly share code, notes, and snippets.

View nelsonic's full-sized avatar
💭
Let's Build a Better World Together!☀️

Nelson nelsonic

💭
Let's Build a Better World Together!☀️
View GitHub Profile
@nelsonic
nelsonic / sort.html
Created April 16, 2013 16:47
ASCII Ascending Order Sort Sort in HTML/JavaScript
<html>
<h1>Sort</h1>
<!-- enable the Chrome Developer Console to see Results -->
<script>
str = 'X,a,A,C,D,F,1,c,4,3'
data = str.split(',')
console.dir(data)
counter = 0;
limit = data.length;
end = limit-1;
This file has been truncated, but you can view the full file.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/8.0.8 Safari/600.8.9
Mozilla/5.0 (iPhone; CPU iPhone OS 8_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) CriOS/44.0.2403.67 Mobile/12D508 Safari/600.1.4
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Firefox/38.0
Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36
Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240
Mozilla/5.0
@nelsonic
nelsonic / softwareengineering
Created September 30, 2019 11:52 — forked from scottashipp/softwareengineering
Software Engineering Quotes for fortune
%
Simple things should be simple, complex things should be possible.
The Wiki Way: Quick Collaboration on the Web, Bo Leuf, Ward
Cunningham
%
Simplicity is the soul of efficiency.
Austin Freeman
%
I have yet to see any problem, however complicated, which, when you
looked at it in the right way, did not become still more complicated.
@nelsonic
nelsonic / llama-7b-m1.md
Created May 22, 2023 17:32 — forked from cedrickchee/llama-7b-m1.md
4 Steps in Running LLaMA-7B on a M1 MacBook with `llama.cpp`

4 Steps in Running LLaMA-7B on a M1 MacBook

The large language models usability

The problem with large language models is that you can’t run these locally on your laptop. Thanks to Georgi Gerganov and his llama.cpp project, it is now possible to run Meta’s LLaMA on a single computer without a dedicated GPU.

Running LLaMA

There are multiple steps involved in running LLaMA locally on a M1 Mac after downloading the model weights.

@nelsonic
nelsonic / up-and-running-with-edeliver-on-do.md
Created May 10, 2017 19:21 — forked from mattweldon/up-and-running-with-edeliver-on-do.md
Getting Elixir / Phoenix running on Digital Ocean with edeliver

Build Server

  • Go to Digital Ocean
  • Create new droplet
  • London
  • Ubuntu
  • No apps
  • Add SSH keys
@nelsonic
nelsonic / recursiveGet.js
Last active April 26, 2021 17:19 — forked from deepanprabhu/gist:fbb406c3432c19eafe78a4b44e6a4b23
Concise Recursive DynamoDB Scan - Large Table - Using ExclusiveStartKey and LastEvaluatedKey - NodeJS
// Load the AWS SDK for JS
const AWS = require("aws-sdk");
// Set a region to interact with (make sure it's the same as the region of your table)
AWS.config.update({region: 'eu-west-2'});
// Set a table name that we can use later on
const tableName = "people"
// Create the Service interface for DynamoDB
@nelsonic
nelsonic / change_spec.rb
Created January 19, 2013 04:14
Coin change problem. Solved in Ruby. using each loop Fewest lines (so far) slightly fancy: times and inject methods used - but no faster than the simple nested until loops Requires RSpec to run.
class Change
def change(amount)
available_coins, coins, remaining_amount = [100,50,25,10,5,1], [], amount
available_coins.each { | coin |
if remaining_amount - coin >= 0
remaining_amount / coin != 0 ? (remaining_amount / coin).to_int.times { coins << coin } : coins << coin
puts "Remaining Amount: #{remaining_amount} | Coin: #{coin}" # console feedback :-)
remaining_amount = amount - coins.inject(:+) # see: http://stackoverflow.com/a/1538801/1148249
end
}
@nelsonic
nelsonic / gist:cb4143e3b5be7bfd9a5cf73dfa74a6ac
Created October 15, 2020 11:29 — forked from vargeorge/gist:8b20488b7d7b6c101b4b
Show full path on OS X terminal / iTerm before the $ prompt
1. Edit ~/.bash_profile and add the following line to show full path before the $ prompt.
For example, as user@hostname:path/to/directory$
# show path before the $ prompt
export PS1='\u@\H:\w$ '
2. Save file and restart terminal or run source command
$ source ~/.bash_profile
@nelsonic
nelsonic / var.dart
Created June 12, 2020 17:50
How to use Variables in Dart
main() {
var name = 'Alex'; // or whatever your name is!
print('Hello $name!'); // Hello Alex!
}
@nelsonic
nelsonic / hello.dart
Last active June 12, 2020 17:27
Hello World! in Dart
main() {
print('Hello World!');
}