Skip to content

Instantly share code, notes, and snippets.

View dnyall's full-sized avatar
:shipit:

daniyal abbaszadeh dnyall

:shipit:
  • Iran-tehran
View GitHub Profile
@dnyall
dnyall / Open-Folder-in-JupyterNotebook.sh
Last active December 19, 2024 19:28
osx "automator application" script to add "Open in jupyterNotebook" action in finder
# Steps to Create a Quick Action in Automator for Opening a Folder in Jupyter Notebook:
# 1. In Automator, create a Quick Action.
# 2. Set the workflow to receive current files or folders in any application.
# 3. Add a Run Shell Script action.
# 4. Set “Pass input” as “arguments”.
# 5. Paste the following bash script into the shell script section.
# Now, you can easily open the selected folder in Jupyter Notebook from finder actions. Enjoy!
@mtimbs
mtimbs / tsconfig.json
Last active November 11, 2025 22:07
basic default tsconfig for use in TypeScript projects
{
"compilerOptions": {
// project options
"lib": [
"ESNext",
"dom"
], // specifies which default set of type definitions to use ("DOM", "ES6", etc)
"outDir": "lib", // .js (as well as .d.ts, .js.map, etc.) files will be emitted into this directory.,
"removeComments": true, // Strips all comments from TypeScript files when converting into JavaScript- you rarely read compiled code so this saves space
"target": "ES6", // Target environment. Most modern browsers support ES6, but you may want to set it to newer or older. (defaults to ES3)
# Programming Principles
Every programmer benefits from understanding programming principles and patterns. This overview is a reference for myself, and I've just put it here. Maybe it is of help to you during design, discussion, or review. Please note that it's far from complete, and that you often need to make trade-offs between conflicting principles.
The list was inspired by [The Principles of Good Programming](http://www.artima.com/weblogs/viewpost.jsp?thread=331531). I felt that the list closely, but not completely matches what I would personally put into something similar. Additionally, I wanted a bit more reasoning, details, and links to further resources. [Let me know](https://github.com/webpro/programming-principles/issues) if you have any feedback or suggestions for improvement.
## Contents
### Generic
@bradtraversy
bradtraversy / mongodb_cheat_sheet.md
Last active November 24, 2025 05:49
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@delibytes
delibytes / react-cheatsheet.md
Last active February 19, 2024 18:06
React & JSX Cheatsheet

React & JSX Cheatsheet

Overview
JSX HTML <div>...</div>
JSX Component <Component property={javascript} />
<Component property='string' />
JSX Component with Children <Component>{children}</Component>
reference: props.children
Escaping JavaScript {...}
require statements const React = require('react');
const ReactDOM = require('react-dom');
npm modules react, react-dom
@Techgokul
Techgokul / Matrixrain.html
Created December 7, 2017 12:14
Make a Matrix rain using HTML5,JS,CSS
<html>
<head>
<title>Matrix Rain</title>
<style>
* {margin: 0; padding: 0;}
body {background: black;}
canvas {display: block;}
</style>
</head>
<body>
In general, a cache is a "more local" copy of a memory resource that you want to access.
Its a copy that is faster to access than the original, but that memory is also more expensive.
This link, provides some measurements that illustrate the benefits: http://norvig.com/21-days.html#answers
Disk cache is RAM memory, that contains a copy of the information on the disk.
Typically, when you access something on the drive, the whole page is brought into cache, on the assumption that the next access will be in that page.
The first disk seek might take 8ms, while seeks from cache 100 ns (many times faster - note nanoseconds instead of milliseconds)
Memory cache is the same concept, but the cache is located on the CPU chip. So the original memory access is 100ns, the L1 cache access can be 0.5 ns.
@jareware
jareware / SCSS.md
Last active October 21, 2025 14:22
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso