Skip to content

Instantly share code, notes, and snippets.

View stefanbc's full-sized avatar
🖖
Do; or do not. There is no // TODO

Stefan Cosma stefanbc

🖖
Do; or do not. There is no // TODO
View GitHub Profile
@gilesbowkett
gilesbowkett / gist:5375680
Created April 12, 2013 22:26
simpler yet (thx @wycats)
<script src="handlebars.js"></script>
<script src="jquery-1.9.1.min.js"></script>
<script src="ember-1.0.0-rc.2.js"></script>
<script>
App = Ember.Application.create();
App.Router.map(function() {
this.resource('hi');
});
@james2doyle
james2doyle / create-repo.sh
Created March 20, 2015 19:42
Create a repo on Github from the command line
# replace james2doyle with your own github username
function git-create() {
if [ $# -eq 2 ]; then
# name of repo to be created
PROJECTNAME="$1"
DESCRIPTION="$2"
POST="{\"name\":\"$PROJECTNAME\",\"description\":\"$DESCRIPTION\"}"
curl –sS -u 'james2doyle' https://api.github.com/user/repos -d "$POST"
git remote add origin git@github.com:james2doyle/$PROJECTNAME.git
echo "remote origin added"
@trey
trey / rwd.css
Created January 26, 2012 20:14
Bootstrap's RWD breakpoints
/* http://twitter.github.com/bootstrap/scaffolding.html#responsive */
/* Landscape phones and down */
@media (max-width: 480px) { ... }
/* Landscape phone to portrait tablet */
@media (max-width: 768px) { ... }
/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 940px) { ... }
@denzildoyle
denzildoyle / Ionic Notes.md
Last active September 19, 2017 13:37
Ionic notes: How to get started with Ionic mobile application development framework.

##Getting Started with Ionic Framework

Ionic is a powerful, beautiful and easy to use open source front-end framework built on top of AngularJs (a client-side javascript framework), Sass Syntactically Awesome Style Sheets Apache Cordova for and developing hybrid (cross platform) mobile apps.

Ionic's ultimate goal is to make it easier to develop native mobile apps with HTML5, also known as Hybrid apps.

Install nodejs: http://nodejs.org/

    npm install -g cordova ionic
@ruario
ruario / manual-install-of-opera.md
Last active September 7, 2018 11:49
How to install Opera developer for Linux on distributions other than Debian, Ubuntu or derivatives
@jcsrb
jcsrb / select.js
Last active October 10, 2018 20:33
How open a <select> element programmatically
//Thank to @Formstone https://github.com/Formstone/Selecter/blob/master/src/jquery.fs.selecter.js
if (window.document.createEvent) { // All
var evt = window.document.createEvent("MouseEvents");
evt.initMouseEvent("mousedown", false, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
el.dispatchEvent(evt);
} else if (el.fireEvent) { // IE
el.fireEvent("onmousedown");
}
@rymawby
rymawby / undo-git-rebase.sh
Created June 14, 2013 18:37
Undoing a git rebase
# find head commit
git reflog
# now reset hard - where N is the head commit found in the reflog
git reset --hard HEAD@{N}
@chriscoyier
chriscoyier / frontendplugins.md
Last active March 3, 2021 17:31
How WordPress Plugins Should Handle Front End Resources

How WordPress Plugins Should Handle Front End Resources

This is a WORK IN PROGRESS intended for fleshing out and feedback

It's very common for people to be unhappy with how a WordPress plugin adds front end resources to their site. If a plugin needs CSS, the plugin will add a <link> element to that CSS. If the plugin needs JavaScript, it will add a <script> to that JavaScript.

Plugins do this because it works. It's damn important for a WordPress plugin to work, even in adverse conditions. They rightfully want good ratings and little customer support.

But this comes at the cost of additional HTTP requests. In optimizing front end performance of a site, reducing the number of HTTP requests is a huge thing. Front end developers want to decide and control how front end resources are being handled, and WordPress plugins don't typically make this easy on them.

@stagas
stagas / how-to-run-apache-and-node.js-together-the-right-way.markdown
Created December 24, 2010 14:45
How to run Apache and Node.js together (the right way)

Step 1

Get a VPS that offers 2 or more IP addresses.

Step 2

From the WHM cPanel, find the menu item Service Configuration, select Apache Configuration and then click on Reserved IPs Editor.

Step 3

@travishorn
travishorn / Using Grunt with Travis-CI.md
Last active May 4, 2022 21:59
Using Grunt with Travis-CI

If you are using Grunt to run your tests and Travis-CI for your continuous integration, you will need to command Travis-CI to install the grunt-cli before running your test script(s). grunt-cli is meant to be a global package, so adding it to your dependencies or devDependencies is not ideal.

You'll need the following your package.json...

  • Test script command
  • Grunt and any plugins as dependencies

Like so:

{