Skip to content

Instantly share code, notes, and snippets.

View coopy's full-sized avatar

Per Nilsson coopy

View GitHub Profile
javascript: (function () {
var content = document.querySelectorAll('.article__premium-content')[0];
var intro = document.querySelectorAll('.article__lead')[0];
var payWall = document.querySelectorAll('#serviceplusPaywallpaywall-container')[0];
var social = document.querySelectorAll('.js-social-toolbar')[0];
var ghost = document.querySelectorAll('.article__body--mask .article__lead')[0];
intro.style.overflow = "visible";
content.style.display = "block";
payWall.style.display = "none";
'use strict'
const WIDTH = 800
const HEIGHT = 600
const SIXTY_FPS_DELAY = 1000 / 60
function createContext () {
const canvas = document.getElementById('canvas')
canvas.width = WIDTH
canvas.height = HEIGHT
UPDATE wp_options SET option_value = replace(option_value, 'http://old.com', 'http://localhost:8888') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, 'http://old.com', 'http://localhost:8888');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://old.com', 'http://localhost:8888');
@coopy
coopy / gist:169fc59bcad9f86ac369
Created February 29, 2016 22:56
Managed React input
const Form = React.createClass({
// keeps state and re-renders <Input/> when `handleChange` is called back.
});
const Input = ({ inputValue, handleChange }) => {
return (
<input value={inputValue} onChange={(ev) => {handleChange(ev.target.value)}}
);
}
@coopy
coopy / good-git-practices.md
Last active March 26, 2019 22:50
Good git practices

Good Git Practices

1. Commit often!

  • Each commit in a final pull request should contain one logical change, and tests + checks should run.
  • While you're working on a branch, you should commit often, but you don't have to follow these rules. Instead, once your work is complete, you can use interactive rebase or reset to create new, better organized commits.

2. Squashing commits: No rebase required

@coopy
coopy / posted more 2
Created August 4, 2013 05:07
more posted desc - edited
some more posted body
@coopy
coopy / posted more 2
Created August 4, 2013 05:03
more posted desc
some more posted body
@coopy
coopy / posted more
Created August 3, 2013 17:43
more posted desc
some more posted body
@coopy
coopy / posted
Created August 3, 2013 17:26
posted desc
posted body
mygist1