Skip to content

Instantly share code, notes, and snippets.

@raecoo
raecoo / console.save.js
Last active April 25, 2024 13:19
Save JSON object to file in Chrome Devtool
// e.g. console.save({hello: 'world'})
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
if(typeof data === "object"){
data = JSON.stringify(data, undefined, 4)
@PlugFox
PlugFox / example.dart
Last active April 25, 2024 13:17
Flutter get screenshot from canvas layer
import 'dart:async';
import 'dart:io';
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:gallery_saver/gallery_saver.dart';
import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart';
import 'screenshot.dart';
@GeorgDangl
GeorgDangl / AccountController.cs
Created December 24, 2017 12:39
Appending custom claims when logging in via cookie with Asp.Net Core Identity
public class AccountController : Controller
{
[HttpPost("login")]
[AllowAnonymous]
[ProducesResponseType(204)]
[ProducesResponseType(400)]
public async Task<IActionResult> Login([FromBody] LoginPost model)
{
var user = await _userManager.FindByEmailAsync(model.Identifier)
?? await _userManager.FindByNameAsync(model.Identifier);
@khushal87
khushal87 / blog3.md
Last active April 25, 2024 13:13
Linking a custom domain from Google domains to Vercel app

Linking a custom domain to a deployed application is confusing and at times you don't get a route on how to link the domain with the website. 😫

In this article, I will be explaining how to link a Custom domain brought in Google Domains service to an application hosted on Vercel.

Perks of using vercel is that it allows adding domain without any verification unlike Heroku/Netlify, which means you don't have to add your billing details to add a domain to your application. Moreover, it is fast, efficient, and easy to use.😁

What is Vercel?

​Vercel is a deployment and collaboration platform for frontend developers. ​Vercel enables developers to host websites and web services that deploy instantly and scale automatically – all without any configuration. Source - Official Docs

@metux
metux / totp-token.py
Created September 21, 2023 10:53
simple TOTP token generator w/ qrcode image decoding
#!/usr/bin/env python3
# deps: zbar-tools, oathtool
#
# call it as toptp-token.py <qrimage-filename>
#
# 1. decodes the qrcode image via zbar-img
# 2. parses totp url and extracts parameters (secret, stepping, algo, ...)
# 3. calls oathtool to generate the current token
import subprocess
@falldeaf
falldeaf / keepalive.ps1
Created November 24, 2020 17:39
PowerShell script to keep your locked down computer from going to sleep
Clear-Host
Echo "Keep-alive with Scroll Lock..."
$WShell = New-Object -com "Wscript.Shell"
while ($true)
{
$WShell.sendkeys("{SCROLLLOCK}")
Start-Sleep -Milliseconds 100
$WShell.sendkeys("{SCROLLLOCK}")
@arlbibek
arlbibek / Enable password prompt for administrative action on Windows.md
Last active April 25, 2024 13:08
Enable password prompt for administrative action on Windows

Enable password prompt for administrative action on Windows

screenshot

Watch demo on YouTube at youtu.be/-kcYuMzKqcY or:

  1. Open Registry Editor
  2. Navigate to:
@sibelius
sibelius / AppDelegate.m
Created December 7, 2016 17:26
Print Font Names on IOS for a React Native Project
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
for (NSString* family in [UIFont familyNames])
{
NSLog(@"%@", family);
for (NSString* name in [UIFont fontNamesForFamilyName: family])
{
NSLog(@" %@", name);
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active April 25, 2024 13:06
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
@wojteklu
wojteklu / clean_code.md
Last active April 25, 2024 13:06
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules