Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>First React App</title>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src='https://unpkg.com/babel-standalone@6/babel.min.js'></script>
</head>
<body>
<div id='app'></div>
@rcarmo
rcarmo / puppeteer.js
Last active January 10, 2022 03:49
Trying to get a single-page PDF screenshot out of puppeteer
const puppeteer = require('puppeteer');
function sleep(ms){
return new Promise(resolve=>{
setTimeout(resolve,ms)
})
}
(async() => {
@milankorsos
milankorsos / redux-actions.ts
Last active November 10, 2022 10:58
Correct TypeScript typing example for Redux Thunk actions
import {Action, ActionCreator, Dispatch} from 'redux';
import {ThunkAction} from 'redux-thunk';
// Redux action
const reduxAction: ActionCreator<Action> = (text: string) => {
return {
type: SET_TEXT,
text
};
};
@Akendo
Akendo / netmask_to_cidr.py
Created May 24, 2017 11:23
Converting a netmask to CIDR with vanilla python
def netmask_to_cidr(m_netmask):
return(sum([ bin(int(bits)).count("1") for bits in m_netmask.split(".") ]))
@HaleTom
HaleTom / git-quote-string-multiline
Created October 1, 2016 03:21
Quote a single- or multi-line string for use in git's aliases
#!/bin/bash -eu
# Quote a single- or multi-line string for use in git's aliases
# Copyright (c) 2016 Tom Hale under https://en.wikipedia.org/wiki/MIT_License
quote() {
printf %s "$1" | sed -r 's/(["\\])/\\\1/g';
}
IFS=$(printf '\n')
@mihaitodor
mihaitodor / foo_names.md
Created July 9, 2016 22:05
Map slugs to course names

https://archive.org/download/archiveteam_coursera_20160627114043/coursera_20160627114043.megawarc.warc.gz

  • bigdata = Web Intelligence and Big Data
  • clinical skills = Teaching and Assessing Clinical Skills
  • comp finance = Introduction to Computational Finance and Financial Econometrics
  • data sci = Introduction to Data Science
  • dmathgen = 离散数学概论 Discrete Mathematics Generality
  • global introuslaw = The Global Student's Introduction to U.S. Law
  • global theatre = Theatre and Globalization
  • global theatre = Theatre and Globalization
  • inforiskman = Information Security and Risk Management in Context
#!/bin/bash
# Run this script just before you put the laptop in the bin for security scanning.
# You can add the seconds the laptop will be waiting before speaking. The default
# is waiting for 180 seconds (3 minutes).
# Switch to the login screen, effectively locking the screen.
function lockscreen() {
/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend
}
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@manigandham
manigandham / rich-text-html-editors.md
Last active May 3, 2024 19:37
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors