Skip to content

Instantly share code, notes, and snippets.

View serhatyuna's full-sized avatar
⏲️

Serhat Yuna serhatyuna

⏲️
  • Commencis
  • İzmir, Turkey
View GitHub Profile
alexcvzz.vscode-sqlite
andys8.jest-snippets
apollographql.vscode-apollo
austincummings.razor-plus
bobsparadox.seti-black
BriteSnow.vscode-toggle-quotes
christian-kohler.npm-intellisense
christian-kohler.path-intellisense
CoenraadS.bracket-pair-colorizer
dbaeumer.vscode-eslint

Cheat sheet: classes in JavaScript

Basic members of classes

class OtherClass {}

class MyClass1 extends OtherClass {

  publicInstanceField = 1;
@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@Akryum
Akryum / example.js
Last active June 13, 2022 17:28
Vue Router - Navigate to parent named route
export default {
const parents = getNamedParents(this.$router.options.routes, this.$route.matched)
if (parents.length) {
return {
name: parents[parents.length - 1].name,
}
}
return { name: 'home' }
}
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active July 24, 2024 10:54
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@tolgahanuzun
tolgahanuzun / app.py
Last active September 4, 2019 12:58
In #Spotify, I wrote a tiny #python script to add my favorite songs to a list. You can create your own list by taking your own app and oauth information.
import sys
import spotipy
import spotipy.util as util
scope = 'user-library-read playlist-modify-private'
if len(sys.argv) > 1:
username = sys.argv[1]
playlist_name = sys.argv[2]
else:
@mikaello
mikaello / group-objects-by-property.md
Last active December 9, 2023 11:15 — forked from JamieMason/group-objects-by-property.md
Group Array of JavaScript Objects by Key or Property Value

Group array of JavaScript objects by keys

This fork of JamieMason's implementation changes the key parameter to be an array of keys instead of just a single key. This makes it possible to group by multiple properties instead of just one.

Implementation

const groupBy = keys => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = keys.map(key => obj[key]).join('-');
<div id="fakeurlbar" style="display: none; position: fixed; top: 0px; left: 0; height: 74.77037037037037px; width: 100vw; background-image: url('{% link assets/2019-04-27/bar_background.png %}'); background-size: 19px 74.77037037037037px;">
<img src="{% link assets/2019-04-27/bar_left.png %}" style="float: left; width: 211.72222222222223px;"/>
<img src="{% link assets/2019-04-27/bar_right.png %}" style="float: right; width: 124.74444444444444px;"/>
</div>
<script>
let scrollJailEl = null;
const initialHeight = window.innerHeight;
const fakeUrlBarEl = document.getElementById("fakeurlbar");
const fakeTopHeight = 1000;
public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<ApplicationDbContext>
{
public ApplicationDbContext CreateDbContext(string[] args)
{
IConfigurationRoot configuration = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile(@Directory.GetCurrentDirectory() + "/../MyCookingMaster.API/appsettings.json").Build();
var builder = new DbContextOptionsBuilder<ApplicationDbContext>();
var connectionString = configuration.GetConnectionString("DatabaseConnection");
builder.UseSqlServer(connectionString);
return new ApplicationDbContext(builder.Options);
}
@jegazhu
jegazhu / datatables-excel-cell-style.markdown
Created March 31, 2019 17:16
DataTables Excel cell style

DataTables Excel cell style

Example of applying cell styles to an excel file created by dataTables buttons extension.

A Pen by Jaime Gaspar on CodePen.

License.