This file contains hidden or 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
csharp> 0x80000000.GetType() | |
System.UInt32 | |
csharp> 0x40000000.GetType() | |
System.Int32 |
This file contains hidden or 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.exports = function (fileInfo, { | |
jscodeshift, | |
}, options) { | |
// Work around for https://github.com/facebook/jscodeshift/issues/262 | |
const isUnix = fileInfo.source.indexOf('\r\n') === -1; | |
const dom = jscodeshift(fileInfo.source); | |
const topLevelStatements = jscodeshift(dom.get('program', 'body').value).filter(path => { | |
return jscodeshift.Statement.check(path.node); | |
}); | |
// Don’t add another one if it is already there. |
This file contains hidden or 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
#!/bin/sh | |
# The find ignores any VS build folders and minified files. It | |
# then grabs any *.js and passes them to xargs. | |
# | |
# The xargs runs a script per each file which is unfortunately inside | |
# of "" so everything has to be escaped, making the inside unreadable. | |
# The sed takes any line ending in opening square bracket ‘[’, comma ‘,’, | |
# space ‘ ’ and removes the newline. It took me a long time to figure out | |
# how to get sed to join lines together. It involves some ridiculousness |
This file contains hidden or 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
ohnobinki@gibby /tmp/.private/ohnobinki/testx $ LC_ALL=C ls -la | |
total 14636 | |
drwxr-xr-x 2 ohnobinki users 120 Jun 11 20:37 . | |
drwx-----T 16 ohnobinki users 440 Jun 11 20:17 .. | |
-rw-r--r-- 1 ohnobinki users 3069158 Jun 11 20:17 IMG_20180327_165234.jpg | |
-rw-r--r-- 1 ohnobinki users 2939105 Jun 11 20:37 x.7z | |
-rw-r--r-- 1 ohnobinki users 5900455 Jun 11 20:18 x.tar.gz | |
-rw-r--r-- 1 ohnobinki users 3069158 Jun 11 20:17 x2.jpg |
This file contains hidden or 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
> System.Text.Encoding.Default.HeaderName | |
"Windows-1252" |
This file contains hidden or 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
a | |
<!-- hi --> | |
b |
This file contains hidden or 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
EC_Model.prototype.validate_string=function(a,b,c) { | |
if(!_.isNull(a)) { | |
if(_.isString(a)) { | |
if(a.length>b) { | |
return Errors.Too_Long(b); | |
} | |
if(a.match(/<script/gi)) { | |
return Errors.No_Script(); | |
} }else { | |
return Errors.Invalid_Type(); |
This file contains hidden or 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
Console.WriteLine("| `left` | `right` | `left.IsAssignableFrom(right)` |"); | |
Console.WriteLine("| --- | --- | --- |"); | |
var types = new[] { | |
typeof(object), | |
typeof(string), | |
}; | |
foreach (var left in types) { | |
foreach (var right in types) { | |
Console.WriteLine($"| {left} | {right} | {left.IsAssignableFrom(right)} |"); | |
} |
This file contains hidden or 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
binki@DESKTOP-QPI02O2 MSYS ~/source/repos/AddMissingUsingExtraneousCarriageReturn/AddMissingUsingExtraneousCarriageReturn | |
$ hexdump -C Class2.cs | |
00000000 ef bb bf 75 73 69 6e 67 20 53 79 73 74 65 6d 2e |...using System.| | |
00000010 49 4f 3b 0d 0a 75 73 69 6e 67 20 53 79 73 74 65 |IO;..using Syste| | |
00000020 6d 2e 54 65 78 74 2e 52 65 67 75 6c 61 72 45 78 |m.Text.RegularEx| | |
00000030 70 72 65 73 73 69 6f 6e 73 3b 0a 0a 6e 61 6d 65 |pressions;..name| | |
00000040 73 70 61 63 65 20 41 64 64 4d 69 73 73 69 6e 67 |space AddMissing| | |
00000050 55 73 69 6e 67 45 78 74 72 61 6e 65 6f 75 73 43 |UsingExtraneousC| | |
00000060 61 72 72 69 61 67 65 52 65 74 75 72 6e 0a 7b 0a |arriageReturn.{.| | |
00000070 20 20 20 20 63 6c 61 73 73 20 43 6c 61 73 73 32 | class Class2| |
This file contains hidden or 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 | |
// Works around issue described at | |
// https://github.com/facebook/create-react-app/issues/3574#issuecomment-410141752 | |
// To use, add this as “&& ./build-precache-fixup.js” to | |
// package.json/scripts.build. | |
const crypto = require('crypto'); | |
const fs = require('fs'); | |
const path = require('path'); |