Skip to content

Instantly share code, notes, and snippets.

View vivainio's full-sized avatar

Ville Vainio vivainio

View GitHub Profile
18:20:35 [build] System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
18:20:35 [build] at Microsoft.Silverlight.Build.Tasks.ZLibWrapper.compress2(Byte[] compressedBuffer, Int32& compressedBufferLen, Byte[] sourceBuffer, Int32 sourceLength, Int32 compressionLevel)
18:20:35 [build] at Microsoft.Silverlight.Build.Tasks.ZLibWrapper.CompressBytes(Byte[] data, Int32 length, Byte[]& compressedData, Int32& compressedLength)
18:20:35 [build] at Microsoft.Silverlight.Build.Tasks.ZipArchiveFile.WriteToStream(Stream writer)
18:20:35 [build] at Microsoft.Silverlight.Build.Tasks.ZipArchive.Close()
18:20:35 [build] at Microsoft.Silverlight.Build.Tasks.XapCacheFile.PersistFilesToZipFile(String zipFilename, TaskLoggingHelper log)
18:20:35 [build] at Microsoft.Silverlight.Build.Tasks.PackagePlatformExtensions.Execute()
18:20:35 [build] at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Ex
ERROR in <REDACTED>: error TS2345: Argument of type '{ currentDirtyChange: IObservableFactory & IObservableFactories &
{ enhancer: IEnhancer<any>; }; }'
is not assignable to parameter of type '{ prototype: MethodDecorator | PropertyDecorator; }'.
Object literal may only specify known properties, and 'currentDirtyChange'
does not exist in type '{ prototype: MethodDecorator | PropertyDecorator; }'.
export function logDump(...args) {
const l = [].slice.call(arguments).map(toJS);
console.log(...l);
}
when(() => {
return this.postsService.stateSettledSomehow()
}).then(() => {
initObservers()
})
class PostsReaderComponent {
ngOnInit() {
const disposer = startObservers(null, "PostsReader.", [
[
"Loading",
() => {
this.loading = this.postsService.getPost(this.docId) != null
}
],
[
getPostAndAuthorData = createTransformer((postId: string) => {
const post = this.getPost(postId);
if (!post) return undefined;
const author = this.getAuthor(post.authorId);
if (!author) return undefined;
return {
post,
author
}
});
// fake typings for mobx
declare var mobx: {
computed: any;
autorun: (expr: () => void ) => (()=> void);
observable: any;
}
@vivainio
vivainio / settings.json
Created February 4, 2018 16:34
Ligatures + fira for vscode
{
"editor.fontFamily": "Fira Code Light",
"editor.fontSize": 13,
"editor.fontLigatures": true
}
// create function that runs detectchanges after running the function
export function andDetectChanges(cdr: ChangeDetectorRef, expr: () => void) {
function changeDetectWrapper() {
expr();
cdr.detectChanges();
}
return changeDetectWrapper;
}
<!-- using the 'props' Angular directive -->
<my-component props="{foo:['hello', 'world']}"></my-component>