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
@sormy
sormy / png2icns
Created February 12, 2018 07:38
Script to convert png to icns
#!/usr/bin/env bash
# Author: Artem Butusov <art.sormy@gmail.com>
# Version: 1.0
# Idea: https://stackoverflow.com/questions/12306223/how-to-manually-create-icns-files-using-iconutil
source="$1"
if [ -z "$source" ]; then
echo "Usage: png2icns <file.png>"
@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
@sheharyarn
sheharyarn / request.js
Last active August 24, 2023 14:55
Axios Request Wrapper for React (https://to.shyr.io/axios-requests)
/**
* Axios Request Wrapper
* ---------------------
*
* @author Sheharyar Naseer (@sheharyarn)
* @license MIT
*
*/
import axios from 'axios'
@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
)
@ericelliott
ericelliott / class-constructor-factory-examples.js
Last active August 28, 2023 18:18
Class, Constructor, Factory
// class
class ClassCar {
drive () {
console.log('Vroom!');
}
}
const car1 = new ClassCar();
car1.drive();
@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';
@markbrouch
markbrouch / .gitignore
Last active July 13, 2023 19:15
.gitignore file for front-end projects
# Created by https://www.gitignore.io/api/node,bower,osx,linux,windows,dropbox,sass,less,grunt,sublimetext,code
### Node ###
# Logs
logs
*.log
npm-debug.log*
# Runtime data
@paulirish
paulirish / bling.js
Last active April 20, 2024 17:39
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@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