Skip to content

Instantly share code, notes, and snippets.

View etiennejcharles's full-sized avatar
🏠
Working from home

Etienne-Joseph Charles etiennejcharles

🏠
Working from home
  • Staples Business Advantage Canada
  • Montreal, QC
View GitHub Profile
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="MyProject">
<description>PSR-2 plus extras</description>
<rule ref="PSR2" />
<!-- Verifies that class members have scope modifiers. -->
<rule ref="Squiz.Scope.MethodScope" />
<!-- Discourages the use of deprecated functions that are kept in PHP
@sebmarkbage
sebmarkbage / JSXSpreadAttributes.md
Last active August 13, 2020 15:18
JSX Spread Attributes

JSX Spread Attributes

If you know all the properties that you want to place on a component a head of time, it is easy to use JSX:

  var component = <Component foo={x} bar={y} />;

Mutating Props is Bad, mkay

@mac2000
mac2000 / webstorm.cmd
Last active September 1, 2020 18:46 — forked from amnuts/phpstorm.bat
Open with WebStorm context menu
@ECHO OFF
REM Remove registry if any
REG DELETE "HKEY_CLASSES_ROOT\Directory\shell\WebStorm" /f
REM Get WebStorm executable path
FOR /F "usebackq tokens=3*" %%A IN (`REG QUERY "HKEY_CLASSES_ROOT\Applications\WebStorm.exe\shell\open\command"`) DO (
SET WEBSTORM=%%A %%B
)
@jackreichert
jackreichert / inputtitle_submit.js
Last active September 26, 2020 15:03
Example showing how to use AJAX in WordPress
(function ($) {
$(document).ready(function () {
$('#next').click(function () {
$.post(
PT_Ajax.ajaxurl,
{
// wp ajax action
action: 'ajax-inputtitleSubmit',
// vars
@tathamoddie
tathamoddie / RequiresPowerShell.bat
Created August 5, 2010 03:48
Batch file to automatically detect, download and install PowerShell 2 on to an XP SP3 machine
@echo off
REM If PowerShell 2 is not installed, this script will automatically download and install it.
REM Only works on XP SP3 with .NET 3.5. Only for dev boxes, not designed for servers.
REM Based on http://blog.codeassassin.com/2009/12/10/no-web-browser-need-powershell/
ver | find "XP" > nul
if %ERRORLEVEL% neq 0 goto not_xp
ver | find "5.1.2600" > nul
@nunomorgadinho
nunomorgadinho / gist:b2d8e5b8f5fec5b0ed946b24fa288a91
Created February 10, 2017 13:30
PHPCS + WordPress Coding Standards
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@wkwiatek
wkwiatek / app-1.spec.ts
Last active December 17, 2021 01:52
Angular 2 test snippets for Angular final version. Codebase for https://developers.livechatinc.com/blog/category/programming/angular-2/
// App
import { Component } from '@angular/core';
@Component({
selector: 'app',
template: '<span>{{ sayHello() }}</span>',
})
export class App {
public name: string = 'John';
@mfilej
mfilej / db_terminate_backend.rake
Created July 7, 2013 11:02
Rake task to terminate idle postgresql connections that prevent a database to be dropped
# http://stackoverflow.com/questions/5108876/kill-a-postgresql-session-connection
namespace :db do
desc "Fix 'database is being accessed by other users'"
task :terminate => :environment do
ActiveRecord::Base.connection.execute <<-SQL
SELECT
pg_terminate_backend(pid)
FROM
pg_stat_activity
WHERE
@bendc
bendc / nodelist-iteration.js
Created January 13, 2015 14:39
ES6: Iterating over a NodeList
var elements = document.querySelectorAll("div"),
callback = (el) => { console.log(el); };
// Spread operator
[...elements].forEach(callback);
// Array.from()
Array.from(elements).forEach(callback);
// for...of statement