Skip to content

Instantly share code, notes, and snippets.

View neopunisher's full-sized avatar
🎯
Focusing

Carter Cole neopunisher

🎯
Focusing
View GitHub Profile
@Avaq
Avaq / combinators.js
Last active March 18, 2025 22:17
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@SZanlongo
SZanlongo / NASA10commandments.md
Created July 18, 2015 04:03
NASA’s ten coding commandments

NASA’s ten coding commandments

  1. Restrict all code to very simple control flow constructs – do not use goto statements, setjmp or longjmp constructs, and direct or indirect recursion.
  2. All loops must have a fixed upper-bound. It must be trivially possible for a checking tool to prove statically that a preset upper-bound on the number of iterations of a loop cannot be exceeded. If the loop-bound cannot be proven statically, the rule is considered violated.
  3. Do not use dynamic memory allocation after initialization.
  4. No function should be longer than what can be printed on a single sheet of paper in a standard reference format with one line per statement and one line per declaration. Typically, this means no more than about 60 lines of code per function.
  5. The assertion density of the code should average to a minimum of two assertions per function. Assertions are used to check for anomalous conditions that should never happen in real-life executions. Assertions must always be side-effect free
@danawoodman
danawoodman / 0-react-hello-world.md
Last active March 9, 2024 00:32
React Hello World Examples

React "Hello World" Examples

Below are a small collection of React examples to get anyone started using React. They progress from simpler to more complex/full featured.

They will hopefully get you over the initial learning curve of the hard parts of React (JSX, props vs. state, lifecycle events, etc).

Usage

You will want to create an index.html file and copy/paste the contents of 1-base.html and then create a scripts.js file and copy/paste the contents of one of the examples into it.

@shri
shri / tordosetup
Last active July 16, 2016 18:51
How to install a publicly accessible, but unlisted, Tor Relay on Digital Ocean
## start a droplet w/ debian installed
## ssh into your droplet
$ apt-get install tor tor-arm
$ cd /etc/tor
$ nano torrc
## replace the contents of your torrc file with the below:
SocksPort 9150
@andredumas
andredumas / custom.accessor.js
Last active August 19, 2016 03:06
TechanJS Accessors Example
/**
* Demonstrating configuring a techanjs plot to accept and plot custom data types.
*/
// Either, update the default plot accessor
// All plots have default accessors. Here we are updating the default and redefining how
// to get close from the data
candlestick.accessor().close(function(d) {
return d.currentBid; // Where d is an item in your supplied array
});
@kylemanna
kylemanna / purge.wolfram-engine.txt
Created August 2, 2014 21:46
Raspberry Pi + wolfram-engine => Wasted Space
pi@rpi0 ~ $ sudo apt-get purge wolfram-engine
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
wolfram-engine*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 454 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 77272 files and directories currently installed.)
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@ryanlewis
ryanlewis / google_twunter_lol
Created May 27, 2014 14:28 — forked from jamiew/google_twunter_lol
Naughty word list, compiled by Google and @jamiew
4r5e
5h1t
5hit
a55
anal
anus
ar5e
arrse
arse
ass
@shri
shri / pokemon.json
Last active October 21, 2023 16:31
JSON of pokemon to go with my pokemonMoves.json file
{
"1":{
"name":"Bulbasaur",
"attack":49,
"defense":49,
"evolveLevel":16,
"evolveTo":"2",
"type":"grass",
"moves":[
"tackle",
@neopunisher
neopunisher / changePHPmaxUpload.sh
Last active December 25, 2015 12:49
1st argument is new Mb upload limit
sed -iE 's/upload_max_filesize = [0-9]\+M/upload_max_filesize = '$1'M/g' /etc/php.ini
sed -iE 's/post_max_size = [0-9]\+M/post_max_size = '$1'M/g' /etc/php.ini
grep -n upload_max_filesize /etc/php.ini
grep -n post_max_size /etc/php.ini
/sbin/service httpd restart