Skip to content

Instantly share code, notes, and snippets.

View sygn's full-sized avatar

Željko Tadić sygn

  • Zagreb, Croatia
View GitHub Profile
@sygn
sygn / rename.ps
Created April 24, 2020 10:47
Rename multiple files - windows
get-childitem *.mp3 | foreach { rename-item $_ $_.Name.Replace("Radiohead -", "") }
// source: https://superuser.com/a/578076
@sygn
sygn / yup-async.js
Created May 11, 2020 21:46
async form validation
// email validation
// .test('checkDuplUsername', 'same name exists', function (value) {
// return new Promise((resolve, reject) => {
// kn.http({
// url: `/v1/api/${value}`,
// method: 'head',
// }).then(() => {
// // exists
// resolve(false)
@sygn
sygn / .yml
Created September 15, 2020 21:41 — forked from nishithMobinius/.yml
bitbukcet-pipelines
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:10.15.3
pipelines:
branches:
test: #name of your test branch
@sygn
sygn / eslint_prettier_airbnb.md
Created July 17, 2021 10:30 — forked from bradtraversy/eslint_prettier_airbnb.md
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
@sygn
sygn / AccountController.FacebookCallback1.cs
Created November 17, 2017 20:30 — forked from ntotten/AccountController.FacebookCallback1.cs
Facebook Authentication with the Facebook C# SDK and ASP.NET MVC 4
public ActionResult FacebookCallback(string code)
{
var fb = new FacebookClient();
dynamic result = fb.Post("oauth/access_token", new
{
client_id = "your_app_id_here",
client_secret = "your_app_secret_here",
redirect_uri = RedirectUri.AbsoluteUri,
code = code
});