Skip to content

Instantly share code, notes, and snippets.

View gelevanog's full-sized avatar
🎯
Focusing

Ivan Savchenko gelevanog

🎯
Focusing
  • RIVIS
View GitHub Profile
@avidale
avidale / bert_knn.ipynb
Last active February 11, 2024 16:08
bert_knn.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Angular Universal setup for firebase hosting

1) Install firebase-tools globally

npm i -g firebase-tools

2) Install @angular/platform-server

const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = function(paths) {
return {
module: {
rules: [
{
test: /\.scss$/,
@timdown
timdown / trim_canvas.js
Created July 26, 2017 16:15
Returns a copy of a canvas element with surrounding transparent space removed
var trimCanvas = (function() {
function rowBlank(imageData, width, y) {
for (var x = 0; x < width; ++x) {
if (imageData.data[y * width * 4 + x * 4 + 3] !== 0) return false;
}
return true;
}
function columnBlank(imageData, width, x, top, bottom) {
for (var y = top; y < bottom; ++y) {
@btroncone
btroncone / ngrxintro.md
Last active February 26, 2026 10:29
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@ALF-er
ALF-er / Opinion.md
Last active April 29, 2020 21:16
ReactJS Conf 2016

Disclaimer 1: ΠŸΠ΅Ρ€Π²ΡƒΡŽ которая "ΠΏΡ€ΠΎ Ρ‚ΠΎ Ρ‡Π΅Π³ΠΎ ΠΌΡ‹ достигли" я Ρ‚Π°ΠΊΠΈ пропустил.

Disclaimer 2: МногиС Π΄ΠΎΠΊΠ»Π°Π΄Ρ‹ ΡΠΌΠΎΡ‚Ρ€Π΅Π»ΠΈΡΡŒ ΠΈ ΠΎΡ‚Ρ‡Ρ‘Ρ‚Ρ‹ писались Π² состоянии алкогольного опьянСния.

БСйчас посмотрСл Ben Alpert - What Lies Ahead ΠΎΠ½Π° ΠΏΡ€ΠΎ Ρ‚ΠΎ ΠΊΠ°ΠΊΠΈΠ΅ ΠΈΠ΄Π΅ΠΈ ΠΎΠ½ΠΈ ΠΈΠΌΠ΅ΡŽΡ‚ ΠΎ дальнСйшСм Ρ€Π°Π·Π²ΠΈΡ‚ΠΈΠΈ. И ΠΎΠ½ΠΈ дСлят Π½Π° UX-ΠΈΠ΄Π΅ΠΈ ΠΈ DX-ΠΈΠ΄Π΅ΠΈ. Π’ UX Ρƒ Π½ΠΈΡ…:

@gor181
gor181 / objects-delegation-mutation.js
Last active October 27, 2017 10:14
Delegation, object mutation and how to avoid it. Javascript.
//Some of the examples use spread syntax available via Babel in ES7 proposal.
//Live at: https://jsbin.com/zawavekepo/edit?js,console
//Arrays, slicing and avoiding mutations
const numArray = [10, 20, 30, 40, 50, 60];
const removeAtIndex = (arr, x) => {
return [
...arr.slice(0, x),
...arr.slice(x + 1)
];
@endel
endel / getMoonPhase.js
Created March 25, 2015 16:04
Get Moon Phase by Date, written in JavaScript
/*
* modified from http://www.voidware.com/moon_phase.htm
*/
function getMoonPhase(year, month, day)
{
var c = e = jd = b = 0;
if (month < 3) {
year--;
@asafge
asafge / ng-really.js
Created November 12, 2013 13:06
ng-really? An AngularJS directive that creates a confirmation dialog for an action.
/**
* A generic confirmation for risky actions.
* Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function
*/
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active March 3, 2026 06:20
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>