Skip to content

Instantly share code, notes, and snippets.

View legomushroom's full-sized avatar
🇺🇦
stop russizm

Oleg Solomko legomushroom

🇺🇦
stop russizm
View GitHub Profile
@WebReflection
WebReflection / Object.setPrototypeOf.js
Last active February 24, 2018 04:13
Object.setPrototypeOf(O, proto) full/complete polyfill with boolean flag for partial implementation.
/*jslint devel: true, indent: 2 */
// 15.2.3.2
if (!Object.setPrototypeOf) {
Object.setPrototypeOf = (function(Object, magic) {
'use strict';
var set;
function checkArgs(O, proto) {
if (typeof O !== 'object' || O === null) {
throw new TypeError('can not set prototype on a non-object');
}
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active May 18, 2024 16:25
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@iwek
iwek / csv-to-json.js
Last active April 24, 2024 19:05
CSV to JSON Conversion in JavaScript
//var csv is the CSV file with headers
function csvJSON(csv){
var lines=csv.split("\n");
var result = [];
var headers=lines[0].split(",");
for(var i=1;i<lines.length;i++){
@rlopc
rlopc / costLogisticRegressionRegularized.matlab
Created December 31, 2013 10:52
Compute cost and gradient for logistic regression with regularization
function [J, grad] = costFunctionReg(theta, X, y, lambda)
%COSTFUNCTIONREG Compute cost and gradient for logistic regression with regularization
% J = COSTFUNCTIONREG(theta, X, y, lambda) computes the cost of using
% theta as the parameter for regularized logistic regression and the
% gradient of the cost w.r.t. to the parameters.
% Initialize some useful values
m = length(y); % number of training examples
% You need to return the following variables correctly
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 17, 2024 12:37
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@lifuzu
lifuzu / .gitconfig
Created March 11, 2014 17:09
Three levels of GIT config
# There are 3 levels of git config; project, global and system.
# project: Project configs are only available for the current project and stored in .git/config in the project's directory.
# global: Global configs are available for all projects for the current user and stored in ~/.gitconfig.
# system: System configs are available for all the users/projects and stored in /etc/gitconfig.
# Create a project specific config, you have to execute this under the project's directory.
$ git config user.name "John Doe"
# Create a global config
replace-in-selector($what, $with = '')
/{replace($what, $with , selector())}
{block}
root-selector()
+replace-in-selector('^(\S+).*', '$1')
{block}
.foo
.bar