Skip to content

Instantly share code, notes, and snippets.

View NickyYo's full-sized avatar

Nicholas Mitchell NickyYo

  • Manchester, England, UK
View GitHub Profile
@nealrs
nealrs / giphy.js
Created May 5, 2014 21:32
use the giphy api to search for & add an animated gif to a webpage.
// on page load, search for & display a random gif matching your search term using the Giphy API.
// usage:
// include giphy.js in your <head>
// set q to your search term (e.g. "brunch")
// add <span id = "giphyme"></span> wherever you want to display the image. -- FYI, it will be centered.
// big ups to the Giphy crew (giphy.com)
// 2014 - Neal Shyam [@nealrs | nealshyam.com]
document.addEventListener('DOMContentLoaded', function () {
q = "finger guns"; // search query
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active March 24, 2025 09:22
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@sillygwailo
sillygwailo / article.js
Last active May 15, 2018 09:07
Node module to provide the correct article for words starting with vowels
/*
TODO: * An article that starts a sentence should be capitalized.
* A more comprehensive list of subtleties like "a useful", "a once", "an hour", "an historical"
* Tests
*/
exports.article = function(text) {
var vowels = 'aeiou';
var an_exceptions = ['eucalyptus', 'eunuch', 'euphemism', 'euphemistic', 'euphonium', 'euphoric', 'european', 'once', 'one', 'onesie', 'union', 'unique', 'unison', 'united', 'useful', 'utopia', 'utopic', 'user', 'unicorn'];
var a_exceptions = ['hour', 'historical', 'honorable', 'honourable'];
if (a_exceptions.indexOf(text) != -1 || (vowels.indexOf(text.charAt(1)) == -1 && an_exceptions.indexOf(text) == -1)) {
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active January 15, 2025 08:49
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var assert = require('assert')
console.log('\n===========');
console.log(' mongoose version: %s', mongoose.version);
console.log('========\n\n');
var dbname = 'testing_geojsonPoint';
@martinsik
martinsik / chat-frontend.js
Last active March 22, 2025 16:43
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@oodavid
oodavid / README.md
Last active March 11, 2025 21:41 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@shiawuen
shiawuen / index.html
Created December 29, 2011 15:05
Sample to upload file by chunk
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>test upload by chunk</title>
</head>
<body>
<input type="file" id="f" />
<script src="script.js"></script>
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active October 29, 2024 21:43
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version