-
Fix any inconsistent indentation in your existing files, or Python code will break, since it considers a tab to be 8 and we're about to make it 4.
-
Populate
.gitattributes
in your repository, as below.*.py filter=spabs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// generate a shell command from a text input | |
import { request } from 'node:https'; | |
import { exec } from 'node:child_process'; | |
import { createInterface } from 'node:readline/promises'; | |
import { stdin as input, stdout as output } from 'node:process'; | |
async function call() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// Save this file somewhere and make it executable: `chmod +x http.mjs`, then add to $PATH. | |
// Just run `http.mjs` from any folder to serve the files. | |
import { createServer } from 'node:http'; | |
import { join } from 'node:path'; | |
import { createReadStream, existsSync } from 'node:fs'; | |
import process from 'node:process'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.border { | |
position: relative; | |
background-clip: padding-box; | |
border: 1px solid transparent; | |
border-radius: var(--brand-borderRadius-large); | |
} | |
.border::before { | |
content: ""; | |
position: absolute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import path from 'path'; | |
console.log(Object.keys(path)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Model } from Gisele; | |
const fields = { | |
name: String | |
}; | |
export class User extends Model.new(fields) { | |
modelMethod() { | |
// ... | |
} |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$module.directive('autogrow', autogrowDirective); | |
/** | |
* @directive autogrow | |
*/ | |
function autogrowDirective() { | |
return { | |
link: linker, | |
require: '?ngModel' | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {Function} NewClass | |
* @param {Function} SuperClass | |
* | |
* @example | |
* function Foo() {} | |
* function Bar() { Foo.call(this); } | |
* inherits(Bar, Foo); | |
*/ | |
var inherits = function (NewClass, SuperClass, attributes) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('isValid') | |
.directive('isValid', function() { | |
return { | |
link: linker, | |
require: '^form' | |
}; | |
function linker($scope, $element, $attrs, form) { | |
var expression = $attrs.isValid, | |
name = $attrs.error; |
NewerOlder