Skip to content

Instantly share code, notes, and snippets.

View keremk's full-sized avatar

Kerem Karatal keremk

View GitHub Profile
@notmatt
notmatt / hello_node.md
Created May 27, 2012 19:47
Polyglotconf ad-hoc "intro to node.js" talk

Polyglotconf intro to node.js

If you're interested in learning more in person, VanJS (@vanjs) often has node-related content.

And like Rob and Brock mentioned in the session, they're starting up the Vancouver Node Brigade (@NodeBrigade) for a more node-focused meetup.

Now, as promised, links from the session and some expanded notes. All questions, comments, and pull requests are most welcome.

Installation & Hello World

@rmw
rmw / hash.rb
Created May 16, 2012 13:50
Extend Ruby Hash with method to return a recursive OpenStruct
class Hash
# options:
# :exclude => [keys] - keys need to be symbols
def to_ostruct_recursive(options = {})
convert_to_ostruct_recursive(self, options)
end
private
def convert_to_ostruct_recursive(obj, options)
result = obj
@v1nc3ntlaw
v1nc3ntlaw / rbenv-install-system-wide.sh
Last active December 23, 2020 13:57
rbenv install ruby 1.9.3-p448 on Ubuntu 12.04 LTS
#
# Run as root
# $ bash <(curl -s https://raw.github.com/gist/1631411)
#
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl \
libssl-dev \
final class Loader: BindableObject {
let didChange = PassthroughSubject<Data?, Never>()
var task: URLSessionDataTask!
var data: Data? = nil {
didSet {
didChange.send(data)
}
}
init(_ url: URL) {
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
/**
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
Example:
// Verifies "isFinished" exists on "operation".
NSString *key = SQKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.
# STEP 1: Load
# Load documents using LangChain's DocumentLoaders
# This is from https://langchain.readthedocs.io/en/latest/modules/document_loaders/examples/csv.html
from langchain.document_loaders.csv_loader import CSVLoader
loader = CSVLoader(file_path='./example_data/mlb_teams_2012.csv')
data = loader.load()
@iamatypeofwalrus
iamatypeofwalrus / roll_ipython_in_aws.md
Last active January 22, 2024 11:18
Create an iPython HTML Notebook on Amazon's AWS Free Tier from scratch.

What

Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time
@jdegoes
jdegoes / fpmax.scala
Created July 13, 2018 03:18
FP to the Max — Code Examples
package fpmax
import scala.util.Try
import scala.io.StdIn.readLine
object App0 {
def main: Unit = {
println("What is your name?")
val name = readLine()
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#