Skip to content

Instantly share code, notes, and snippets.

@liziwl
liziwl / 华为历年机试题集合.md
Last active May 6, 2024 20:27
华为机考习题集

华为历年机试题集合


华为机试共3道题,分值分别为60,50,40。时长2小时,上机环境支持语言包括C/C++/Java

搜集的题目均来自网络:
题1~3 code
题4~6 code
题7 code
题8~9 code

@aamaras
aamaras / coreaudioreset
Last active May 6, 2024 20:26
Terminal command to kill coreaudio in OSX 10.8. Use this when Airplay devices appear in the output device list but cannot be successfully selected.
sudo kill `ps -ax | grep 'coreaudiod'| grep 'sbin' | awk '{print $1}'`
@abul4fia
abul4fia / 00README.md
Last active May 6, 2024 20:23
Working with sections in manim

Working with sections in manim

Manim provides out of the box the possibility of marking parts of your scene as separate sections, by using self.next_section(). This will cause a separate video to be rendered for each section, and then all of them will be stitched together for the final result. The final result will be the same as if you hadn't used sections at all.

But the use of sections allows you to mark some of them with the parameter skip_animations=True, and in that case, that section will not be rendered. The code of the section will be run anyway (because it may be defining objects or variables needed in following sections), but for every self.play(), only the final frame will be computed (and not rendered). This ensures that, at the end of the section, all objects are at the same positions as if the animations were played, but skipping the actual rendering significantly reduces the time required to run the code.

In addition, the resulting video when skip_animations=True is used will be s

@vasanthk
vasanthk / System Design.md
Last active May 6, 2024 20:21
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@OrionReed
OrionReed / dom3d.js
Last active May 6, 2024 20:17
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@markasoftware
markasoftware / enterprise_token.rb
Last active May 6, 2024 20:15
OpenProject Enterprise mode for free
############ REPLACE app/models/enterprise_token.rb in the source code with this file! ################
############ also be sure to RESTART OpenProject after replacing the file. ################
############ it doesn't show that enterprise mode is enabled in the settings, but all ################
############ enterprise mode features, such as KanBan boards, are enabled. ################
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 6, 2024 20:14
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@zmts
zmts / tokens.md
Last active May 6, 2024 20:13
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов