Skip to content

Instantly share code, notes, and snippets.

Noitidart Noitidart

Block or report user

Report or block Noitidart

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View regex-weburl.js
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@antichris
antichris / about.md
Created Oct 21, 2013
Fork your own Gist
View about.md

Fork your own Gist

This is a bookmarklet that adds a fully functional Fork button to your own Gist.

If a Fork button is already present in the page, this bookmarklet will set focus to it instead of adding another one.

The change is temporary and the button will disappear as soon as you navigate away from that Gist (clicking the Fork button does this for you as well).


@stephenhardy
stephenhardy / git-clearHistory
Created Apr 26, 2013
Steps to clear out the history of a git/github repository
View git-clearHistory
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@gaearon
gaearon / connect.js
Last active Nov 13, 2019
connect.js explained
View connect.js
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@gitaarik
gitaarik / git_submodules.md
Last active Nov 13, 2019
Git Submodules basic explanation
View git_submodules.md

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@fabiofl
fabiofl / gist:5873100
Created Jun 27, 2013
Clear Mac OS X's icon cache.
View gist:5873100
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
View nginx-fooapp.com
server {
listen 80;
server_name myapp.com;
location / {
# Pass off API and socket requests to the app server
proxy_pass http://127.0.0.1:9000;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@nahanil
nahanil / layout.ejs
Last active Sep 8, 2019
Sails page title
View layout.ejs
<!DOCTYPE html>
<html lang="en">
<head>
<title><%= typeof data !== 'undefined' && data.title ? data.title + ' | ' : (typeof title == 'undefined' ? '' : title + " | " )%><%= sails.config.appName %> | Chinese - English Dictionary &amp; Mandarin Learning Resources</title>
...
@brenopolanski
brenopolanski / npm-list-globally.md
Created Nov 1, 2016
Listing globally installed NPM packages and version
View npm-list-globally.md
npm list -g --depth=0
@tylerlong
tylerlong / AXWindow.swift
Last active Aug 13, 2019
Make window frontmost (BUT not floating. I don't know how to make windows floating)
View AXWindow.swift
import Cocoa
class AXWindow {
let app: AXUIElement
let window: AXUIElement
init(app: AXUIElement, window: AXUIElement) {
self.app = app
self.window = window
You can’t perform that action at this time.