Skip to content

Instantly share code, notes, and snippets.

View tachyons's full-sized avatar
🎯
Focusing

Aboobacker MK tachyons

🎯
Focusing
View GitHub Profile
@tachyons
tachyons / webpack5.md
Last active January 21, 2022 08:12
Js bundling webpacker 5

Switch from Webpacker 5 to jsbundling-rails with webpack 5

This guide provides step-by-step instructions to migration from Webpacker 5 to jsbundling-rails with webpack 5. For upgrading to Webpacker 6 instead, follow this guide or for comparison between Webpacker and jsbundling-rails, see this.

1. Setup jsbundling-rails

First install jsbundling-rails:

# Add to your Gemfile
@tachyons
tachyons / lit_score_submission.rb
Created July 25, 2021 14:07
assignment service
class LtiScoreSubmission
def initialize(assignment: , lis_result_sourced_id:, score: , lis_outcome_service_url: )
@assignment = assignment
@lis_result_sourced_id = lis_result_sourced_id
@score = score
@lis_outcome_service_url = lis_outcome_service_url
@oauth_consumer_key = assignment.oauth_consumer_key
@lti_shared_secret = assignment.lti_shared_secret
end
@tachyons
tachyons / server.rb
Created March 5, 2020 11:53
Simple http server in ruby
# frozen_string_literal: true
require 'socket'
require 'time'
server = TCPServer.new 2000 # Server bound to port 2000
def parse(request_string)
method, path, version = request_string.lines[0].split
{
@tachyons
tachyons / kotlin.md
Created April 7, 2019 14:44
Kotlin Workshop

Kotlin Workshop

  • Advantages over java

    • no boilperate
  • Origin of Kotlin

    • By jetbrains
CREATE TABLE user_shelves(
id serial PRIMARY KEY,
USER_id INTEGER NOT NULL REFERENCES users(id),
shelf_id INTEGER NOT NULL REFERENCES shelves(id),
UNIQUE(user_id, shelf_id)
);
INSERT INTO USER_shelves(user_id,shelf_id) SELECT shelves.user_id, shelves.id AS shelf_id FROM shelves
SELECT * FROM USER_shelves;
@tachyons
tachyons / WebSocketServer.sh
Created May 1, 2017 00:32 — forked from suxue/WebSocketServer.sh
simple WebSocket Server make use of netcat
#!/bin/ksh
typeset port=$((RANDOM % 60000))
while ((port < 30000)); do
port=$((RANDOM % 60000))
done
typeset pipe=`mktemp -u`
mkfifo $pipe
trap "rm -f $pipe" INT
@tachyons
tachyons / curl.md
Last active October 18, 2020 10:41
Installing curl with http2 in ubuntu
sudo apt-get install nghttp2 libnghttp2-dev 
http://curl.haxx.se/download/curl-7.46.0.tar.bz2
tar -xvjf curl-7.46.0.tar.bz2
cd curl-7.46.0
./configure --with-nghttp2 --prefix=/usr/local
make
sudo make install
sudo ldconfig
@tachyons
tachyons / no-comments.js
Created January 25, 2017 07:39 — forked from Darep/no-comments.js
Remove all comments from GitHub Pull Request
// Sometimes it's necessary to do a bit of clean-up
Array.prototype.forEach.call(document.querySelectorAll('.js-comment-delete button'), function(el, i) {
el.removeAttribute('data-confirm');
el.click();
});
@tachyons
tachyons / policy
Created October 23, 2016 11:17
Bmtc assistant privacy policy
we limit data collected about you and your use of the platform;
your personal information is never for sale;
we use and disclose information to prevent people from abusing the platform; but
we never disclose it for any other reason unless required by law.
@tachyons
tachyons / gist:4e711ff68eaf1e2eda8370e17a06c8fc
Created June 6, 2016 10:40
Installing mysql gem for maria db
gem install mysql -- --with-mysql-config=/usr/bin/mariadb_config