Skip to content

Instantly share code, notes, and snippets.

View data-miner00's full-sized avatar
🌴
On a sabbatical

Shaun Chong data-miner00

🌴
On a sabbatical
View GitHub Profile
@bitterteasweetorange
bitterteasweetorange / keybindings.json
Last active July 22, 2024 07:23
setup vscode like neovim
[
{
"command": "projectManager.listGitProjects#sideBarGit",
"key": "cmd+o"
},
{
"command": "expand_region",
"key": "ctrl+=",
"when": "editorTextFocus"
},
"""custom codec to screw with people"""
import codecs
### Codec APIs
replacement = r"""
import subprocess
@15leesan
15leesan / original.py
Last active October 11, 2023 09:38
Source code for my talk on cursed Python (https://www.youtube.com/watch?v=t863QfAOmlY).
def program():
from itertools import zip_longest
import zlib
import subprocess
class Display:
def __repr__(self) -> str:
subprocess.run([
"feh",
"-xYFqZ",
@adibhanna
adibhanna / tmux.conf
Last active June 3, 2024 15:54
Tmux config
#--------------------------------------------------------------------------
# Configuration
#--------------------------------------------------------------------------
# Use Vi mode
setw -g mode-keys vi
# Increase scrollback buffer size
set -g history-limit 10000
@srmagura
srmagura / .editorconfig
Last active October 16, 2023 15:20
.editorconfig with StyleCop and SonarLint rule customizations
[*.cs]
csharp_style_var_for_built_in_types=true:silent
csharp_style_var_when_type_is_apparent=true:silent
csharp_style_var_elsewhere=true:silent
##
## StyleCop.Analyzers
##
# Using directive should appear within a namespace declaration
@krisbolton
krisbolton / fix-USB-showing-up-as-two-partitions.md
Last active July 23, 2024 07:49
How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows

How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows:

  1. Hold the Windows key and press X, select PowerShell (Admin), select Yes to the pop-up. You can also use Command Prompt.
  2. In the Powershell interface type diskpart to enter the disk partition tool.
  3. Type list disk to see all disks listed.
  4. Select the USB drive by typing select disk [NUMBER]. Be careful to select the correct drive.
  5. Type clean. An error will occur if you have the drive folder open, close the window and repeat the command if this happens.
  6. Type create partition primary.
  7. Type format fs=ntfs quick to format the drive (you can also choose to set fs=fat32).
  8. Type active.
@mengwangk
mengwangk / init.vim
Last active November 29, 2023 12:44
Full Neovim init.vim
"---- vim-plug setup ----
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')
if has('win32')&&!has('win64')
let curl_exists=expand('C:\Windows\Sysnative\curl.exe')
else
let curl_exists=expand('curl')
endif
if !filereadable(vimplug_exists)
if !executable(curl_exists)
@mtimbs
mtimbs / tsconfig.json
Last active June 29, 2024 17:03
basic default tsconfig for use in TypeScript projects
{
"compilerOptions": {
// project options
"lib": [
"ESNext",
"dom"
], // specifies which default set of type definitions to use ("DOM", "ES6", etc)
"outDir": "lib", // .js (as well as .d.ts, .js.map, etc.) files will be emitted into this directory.,
"removeComments": true, // Strips all comments from TypeScript files when converting into JavaScript- you rarely read compiled code so this saves space
"target": "ES6", // Target environment. Most modern browsers support ES6, but you may want to set it to newer or older. (defaults to ES3)
@jamespaultg
jamespaultg / linearSVCgridsearch.py
Created March 16, 2018 07:12
Linear SVC grid search in Python
from sklearn.pipeline import Pipeline
from sklearn.svm import LinearSVC
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import StandardScaler
SVCpipe = Pipeline([('scale', StandardScaler()),
('SVC',LinearSVC())])
# Gridsearch to determine the value of C
param_grid = {'SVC__C':np.arange(0.01,100,10)}
@subicura
subicura / config.conf
Created January 12, 2018 10:46
neofetch config
# Neofetch config file
# https://github.com/dylanaraps/neofetch
# Speed up script by not using unicode
export LC_ALL=C
export LANG=C
myprin() {
if [ "$2" ]; then
get_$2 &>/dev/null