Skip to content

Instantly share code, notes, and snippets.

$quirrel Tzikas

View GitHub Profile
@cobyism
cobyism / gh-pages-deploy.md
Last active Jul 6, 2020
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).
View gh-pages-deploy.md

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@zensh
zensh / memorySizeOfObject.js
Created Feb 18, 2013
calculate memory size of javascript object, it is not a accurate value!
View memorySizeOfObject.js
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if(obj !== null && obj !== undefined) {
switch(typeof obj) {
case 'number':
bytes += 8;
break;
case 'string':
@mkhatib
mkhatib / geo.js
Created May 24, 2013
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
View geo.js
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {
View quickSort.js
//JS QuickSort
Array.prototype.quickSort = function() {
var r = this;
if(this.length <= 1) {
return this;
}
var less = [], greater = [];
@rxaviers
rxaviers / gist:7360908
Last active Jul 6, 2020
Complete list of github markdown emoji markup
View gist:7360908

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@osroca
osroca / index.html
Last active Sep 19, 2017
Testing BigML (bigml.io) modeling and predictions with JQuery
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>BigML Prediction Test</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script src="https://code.jquery.com/jquery-1.7.1.js" type="text/javascript"></script>
@natelandau
natelandau / .bash_profile
Last active Jul 2, 2020
Mac OSX Bash Profile
View .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@zapthedingbat
zapthedingbat / logeverything.js
Created Aug 19, 2014
Log every function call to the console
View logeverything.js
(function() {
var call = Function.prototype.call;
Function.prototype.call = function() {
console.log(this, arguments);
return call.apply(this, arguments);
};
}());
@learncodeacademy
learncodeacademy / flightplan-html.md
Last active May 25, 2020
Deploy HTML site with Flightplan
View flightplan-html.md

###Prerequesites

Install flightplan globally

npm install -g flightplan

Install flightplan in your project folder

@devknoll
devknoll / gist:8b274f1c5d05230bfade
Last active Feb 19, 2019
Basic GraphQL example using the GitHub API
View gist:8b274f1c5d05230bfade
import { graphql, GraphQLString, GraphQLInt } from 'graphql';
import { objectType, enumType, schemaFrom, listOf } from 'graphql-schema';
import request from 'promisingagent';
const repositorySortEnum = enumType('RepositorySort')
.value('CREATED', 'created')
.value('UPDATED', 'updated')
.value('PUSHED', 'pushed')
.value('FULL_NAME', 'full_name')
.end();
You can’t perform that action at this time.