Skip to content

Instantly share code, notes, and snippets.

View Skura23's full-sized avatar
😽
Hello world.

PajamaCat Skura23

😽
Hello world.
  • RichSun
View GitHub Profile
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active January 21, 2024 16:28
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@NigelEarle
NigelEarle / Knex-Setup.md
Last active March 28, 2024 09:11
Setup Knex with Node.js

Knex Setup Guide

Create your project directory

Create and initialize your a directory for your Express application.

$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init
@joduplessis
joduplessis / cookie-typescript-utils.ts
Created September 12, 2017 06:50
Setting, deleting and retrieving cookies in Typescript.
@Saul-Mirone
Saul-Mirone / MVVM.js
Last active July 21, 2022 11:59
A simple mvvm
class Register {
constructor() {
this.routes = []
}
regist(obj, k, fn) {
const _i = this.routes.find(function(el) {
if((el.key === k || el.key.toString() === k.toString())
&& Object.is(el.obj, obj)) {
return el
@hunan-rostomyan
hunan-rostomyan / getCookie.ts
Created July 19, 2016 22:49
Get a cookie by name in TypeScript
// Given a cookie key `name`, returns the value of
// the cookie or `null`, if the key is not found.
function getCookie(name: string): string {
const nameLenPlus = (name.length + 1);
return document.cookie
.split(';')
.map(c => c.trim())
.filter(cookie => {
return cookie.substring(0, nameLenPlus) === `${name}=`;
})
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@fleishmanhillard
fleishmanhillard / css-style-guide.md
Created April 4, 2014 21:40
CSS style guide with coding standards and best practices.

CSS Style Guide

All rules and guidelines in this document apply to css/scss files unless otherwise noted.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@leostratus
leostratus / webkit-pseudo-elements.md
Created September 21, 2012 01:44
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;