Skip to content

Instantly share code, notes, and snippets.

View sethdavis512's full-sized avatar
🤖

Seth Davis sethdavis512

🤖
View GitHub Profile
@Spec007
Spec007 / media-queries.css
Created January 24, 2017 14:28
Media-queries
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@bcherny
bcherny / react-rollup-typescript.md
Last active January 30, 2024 12:13
react + rollup + typescript boilerplate

terminal:

npm i --save-dev rollup rollup-watch rollup-plugin-typescript typescript typings
npm i -S react react-dom
./node_modules/.bin/typings install react react-dom --save
mkdir src dist
touch src/index.tsx
@kitze
kitze / plopfile.js
Created May 25, 2016 10:41
A sample plopfile for generating React components and components with containers
module.exports = function (plop) {
/* Helpers */
plop.addHelper('upperCase', function (text) {
return text.toUpperCase();
});
/* Files */
var createIndex = {
type: 'add',
@ebakan
ebakan / Popper.js
Last active January 24, 2018 19:25
React Component for Popper.js that takes the reference as its first child and the popper as its second child (a la react-tether)
import React, { Component, PropTypes } from 'react';
import popperJS from 'popper.js';
export default class Popper extends Component {
constructor(props) {
super(props);
this.state = {};
this.update = this.update.bind(this);
}
@nepsilon
nepsilon / how-to-git-patch-diff.md
Last active April 19, 2024 13:33
How to generate and apply patches with git? — First published in fullweb.io issue #33

How to generate and apply patches with git?

It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what diff outputs to your local working copy.

You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:

1. Generate the patch:

git diff > some-changes.patch
@wesbos
wesbos / tab-trigger.js
Created November 16, 2015 19:33
How to properly get a TAB trigger working with Emmet inside of JSX
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
"context": [
{
@peterpme
peterpme / RadioBtnGroup.jsx
Created September 21, 2015 19:31
Radio Button Group in React
const RadioBtnGroup = React.createClass({
getDefaultProps() {
return {
options: []
}
}
handleValueChange(evt) {
this.setState({
value: evt.currentTarget.value
@tmpvar
tmpvar / my-first-module.md
Last active December 20, 2021 18:48
how to create your very first node.js module and publish it to the npm registry

building your first node module

This is pretty simple, lets dive in!

choose a name

Find a name that isn't taken and clearly describes what your module is doing

$ npm view your-first-node-module
@alisterlf
alisterlf / gist:3490957
Created August 27, 2012 18:10
JAVASCRIPT:Remove Accents
function RemoveAccents(strAccents) {
var strAccents = strAccents.split('');
var strAccentsOut = new Array();
var strAccentsLen = strAccents.length;
var accents = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
var accentsOut = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz";
for (var y = 0; y < strAccentsLen; y++) {
if (accents.indexOf(strAccents[y]) != -1) {
strAccentsOut[y] = accentsOut.substr(accents.indexOf(strAccents[y]), 1);
} else
//
// 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)
//