Skip to content

Instantly share code, notes, and snippets.

@barockok
barockok / veritrans_vtweb_activemerchant_snippet.rb
Last active December 24, 2015 02:19
Sample code for implementation vt-web with activemerchant
merchant_id = 'XXXXXXXXXXXXXXXXXXX'
merchant_hash_key = 'XXXXXXXXXXXXXXXXXXX'
# implemetation for generating form
payment_service_for @order.id, merchant_id, \
merchant_hash_key: merchant_hash_key,
service: :veritrans,
amount: @order.total_amount,
currency: 'IDR',
html: {:id => 'payment-form' , :authenticity_token => false } do |service|
@alieseparker
alieseparker / Floyd-Warshall
Last active January 1, 2018 14:26
Floyd-Warshall - Find shortest path
# Floyd-Warshall Algorithm
## Introduction:
Finds Shortest Path (or longest path) among all pairs of nodes in a graph.
Complexity: O(|n|³)
## How does it work?
- There can be more than one route between two nodes.
- The number of nodes in the route isn’t important (Path 4 has 4 nodes but is shorter than Path 2, which has 3 nodes)
- There can be more than one path of minimal length
@OliverJAsh
OliverJAsh / bar-es6.js
Created November 13, 2014 20:33
sandboxed-module error with transitive ES6 deps
export default 'bar';
@danharper
danharper / gulpfile.js
Last active April 11, 2024 08:31
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@w0rd-driven
w0rd-driven / passwords.txt
Created November 18, 2016 20:19
BFG Repo-Cleaner --replace-text example
PASSWORD1 # Replace literal string 'PASSWORD1' with '***REMOVED***' (default)
PASSWORD2==>examplePass # replace with 'examplePass' instead
PASSWORD3==> # replace with the empty string
regex:password=\w+==>password= # Replace, using a regex
regex:\r(\n)==>$1 # Replace Windows newlines with Unix newlines
@jirikuncar
jirikuncar / README.md
Last active April 23, 2021 17:44
Traefik - header matching

Traefik routing

Proxy to services based on Accept header.

Run

docker-compose up -d

Test

@Birch-san
Birch-san / local-copilot.md
Last active March 12, 2024 15:14
Running GitHub Copilot against local Code Llama model

Running GitHub Copilot VSCode extension against local Code Llama model

image

image

Tested on NVIDIA RTX 4090, but these instructions also cover AMD and Mac in case you wanna try those.
This guide assumes you are running Linux (I ran this on Ubuntu).

Before you get excited: