Skip to content

Instantly share code, notes, and snippets.

View dianjuar's full-sized avatar

Diego Julião dianjuar

View GitHub Profile
@jdjuan
jdjuan / wait.ts
Created March 29, 2020 10:41
Improve readability of setTimeout(fn, 0)
wait(): Promise<void> {
return new Promise((resolve: () => void): void => {
setTimeout(resolve);
});
}
@mgol
mgol / jquery-es6-example.md
Last active October 12, 2023 10:34
jQuery ES6 modules example usage

jQuery source is now authored using ES6 modules. It's possible to use them directly in the browser without any build process.

To test it locally, first clone the jQuery repository:

git clone [email protected]:jquery/jquery.git

Then, write the following index.html file:

@MelissaKaulfuss
MelissaKaulfuss / installing_ruby_versions_with_chruby.md
Last active August 4, 2023 19:28
How to install different Ruby versions with chruby

Managing Ruby Versions with chruby

So I'm always forgetting how to do this! I guess I'm only ever updating Ruby versions every now and then.

Checking out which Ruby versions chruby has access to

$ chruby will display your installed rubies and show you the version you're currently using in your shell.

   ruby-2.1.2
   ruby-2.2.1
 ruby-2.3.1
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active November 16, 2024 00:19
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@nblackburn
nblackburn / camelToKebab.js
Last active December 15, 2023 03:19
Convert a string from camel case to kebab case.
module.exports = (string) => {
return string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
};
@jalal
jalal / .gitignore
Created February 5, 2017 16:38
Nativescript .gitignore file
npm-debug.log
.DS_Store
*.js.map
*.metadata.json
app/**/*.js
npm-debug.log
hooks/
lib/
@miguelmota
miguelmota / i3-cheat-sheet.md
Last active October 8, 2024 08:21 — forked from JeffPaine/i3-cheat-sheet.md
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (window/command or alt by default depending on config)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3
import {Directive, ViewContainerRef, TemplateRef, Inject} from '@angular/core';
import {Device, platformNames} from "platform";
import {DEVICE} from "nativescript-angular/platform-providers";
@Directive({ selector: "[ifAndroid]" })
export class IfAndroidDirective {
constructor( @Inject(DEVICE) device: Device, container: ViewContainerRef, templateRef: TemplateRef<Object>) {
if (device.os === platformNames.android) {
container.createEmbeddedView(templateRef);
}
@thebinarypenguin
thebinarypenguin / sudoku-board.html
Created May 28, 2016 15:57
A sample Sudoku board in HTML and CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>HTML Sudoku Board</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
@lukas-h
lukas-h / license-badges.md
Last active November 11, 2024 03:22
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)