Skip to content

Instantly share code, notes, and snippets.

View olecksamdr's full-sized avatar

Oleksandr olecksamdr

View GitHub Profile
@olecksamdr
olecksamdr / scripts.js
Created August 24, 2016 07:20
jquery smooth scroll to element
/***************** Smooth Scroll ******************/
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') && location.hostname === this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
@olecksamdr
olecksamdr / index.html
Last active August 28, 2016 21:01
star rating (pure js)
<div class="star-rating" data-current="5">
<span>★</span>
<span>★</span>
<span>★</span>
<span>★</span>
<span>★</span>
</div>
using System;
class binaryCalc {
static char[] operations = {'+', '-', '*', '/'};
static string getOperation(string str) {
foreach (char operation in operations) {
if (str.IndexOf(operation) != -1) {
return new String(operation, 1);
}
using System;
using System.IO;
using System.Text;
class directoryTree {
static int nestingLevel = 0;
static void printSpaces(int n) {
n *= 3;
using System;
using System.IO;
using System.Text.RegularExpressions;
using System.IO.Compression;
namespace Compression
{
class MyCompression
{
static string removeExt(string str) {
#include "stdafx.h"
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
using namespace std;
vector<double> strToIntVector(string& str) {
vector<double> numbers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
public class Person
{
// Необхідність стиску зображень
//C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
namespace arithmeticCompession
{
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
// class MyMap<TKey, TValue>: IEnumerable
// {
// private List<KeyValuePair<TKey, TValue>> items = new List<KeyValuePair<TKey, TValue>>();
// public MyMap()
// 2.2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
#include <cstdlib>
#include <algorithm>
using namespace std;