Skip to content

Instantly share code, notes, and snippets.

View chrisjlee's full-sized avatar
💭
🏈

Chris J. Lee chrisjlee

💭
🏈
View GitHub Profile
@chrisjlee
chrisjlee / phprc
Created August 7, 2016 05:46 — forked from amnuts/phprc
Dreamhost PHP 5.6 phprc file
date.timezone = "Europe/London"
expose_php = 0
extension = phar.so
extension = fileinfo.so
extension = intl.so
suhosin.executor.include.whitelist = phar
[opcache]
zend_extension=opcache.so
@chrisjlee
chrisjlee / simple-mail-script.php
Created August 4, 2016 02:42
Simple mail test script
<?php
$to = "your@email.com"; // REPLACE
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "noreply@eample.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
@chrisjlee
chrisjlee / testing-es2015-constants.js
Last active June 16, 2016 16:35
ES 2015 constants - overriding constants inside another function
console.log('outside', test);
(() => {
const test = 2;
console.log('inside', test);
return test
})();
@chrisjlee
chrisjlee / open-chrome.sh
Last active June 27, 2017 00:24
open chrome and disable web security
#!/usr/bin
open -a Google\ Chrome --args --disable-web-security --user-data-dir
@chrisjlee
chrisjlee / delete-feature-branches.sh
Last active March 30, 2022 21:51
Delete feature branch with prefix locally then remove all remote feature branches
# Stole from:
# http://stackoverflow.com/questions/32122784/alias-script-to-delete-all-local-and-remote-git-branches-with-a-specific-prefix
git branch -D $(printf "%s\n" $(git branch) | grep 'feature/')
# Or this will work too to remove all remote branches:
# https://coderwall.com/p/eis0ba/remove-a-thousand-stale-remote-branches-on-git
git branch -r | awk -F/ '/\/feature/{print $2}' | xargs -I {} git push origin :{}
# Prune all origin branches
git remote prune origin
@chrisjlee
chrisjlee / delete-feature.sh
Created March 30, 2016 22:26
Delete branch with prefix
git branch -D `git branch | grep 'feature/*'`
# http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
# http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
@chrisjlee
chrisjlee / README.md
Last active November 3, 2018 13:42
Simple project setup with webpack, typescript and hot reloading

Angular 2.x Quickstart

This is shell project for configuring a typical project for angular 2.x. It includes the most naive example of an angular 2.x project. This uses some of the typical tools: webpack, karma, jasmine, typescript, sass.

Inspired by https://github.com/jeffbcross/aim

@chrisjlee
chrisjlee / error-catch.es
Created March 18, 2016 15:25
Handling Promise errors
promise.catch(error => {
if (error instanceof OkayError) {
return Observable.of('okay');
} else {
throw error
}
})