Skip to content

Instantly share code, notes, and snippets.

View janziemba's full-sized avatar
✌️
🇺🇦🇨🇿

Jan Ziemba janziemba

✌️
🇺🇦🇨🇿
View GitHub Profile
var sys = require('sys');
function swap32(src) {
return (
((src & 0xFF000000) >> 24) +
((src & 0x00FF0000) >> 8) +
((src & 0x0000FF00) << 8) +
((src & 0x000000FF) << 24)
);
}
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@rahul100885
rahul100885 / nginx.conf
Created August 17, 2011 08:44
Nginx configuration for force https and www url
user deploy;
worker_processes 6;
events {
worker_connections 1024;
}
http {
passenger_root /usr/local/rvm/gems/ree-1.8.7-2011.03/gems/passenger-3.0.7;
@rxaviers
rxaviers / gist:7360908
Last active July 21, 2024 12:41
Complete list of github markdown emoji markup

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:
@mischah
mischah / z.md
Last active December 9, 2022 02:11
Installing und initializing z (https://github.com/rupa/z) with help of Homebrew.

#The power of z

Do you spend lots of time doing things like this?

cd this/is/the/path/that/i/want/so/i/type/it/all/out/to/get/whereiwant

With z, you could just do this:

@ddre54
ddre54 / nginx.conf
Created April 17, 2014 16:39
NGINX configuration to detect and redirect unsupported browsers
# # IE 10 +
# # Firefox 27 +
# # Safari 7 +
# # iOS Safari 5 +
# # IE mobile 10 +
# # Android 4.2 +
# # Blackberry 10 +
# # Chrome 31+
#
@joyrexus
joyrexus / README.md
Last active January 26, 2024 16:53
Bullet trajectories

Click or tap to fire an artillery shell. Hold to fire multiple shots.

The trajectory is calculated and plotted based on the firing angle, gravity, and initial bullet velocity.

Notes

All code here is taken straight from the Game Mechanic Explorer, a collection of concrete examples for various game mechanics, algorithms, and effects. The examples are all implemented in JavaScript using the Phaser game framework, but the concepts and methods are general and can be adapted to any engine.

@mscdex
mscdex / test.js
Last active September 15, 2023 11:55
sharing sessions between node.js and php using redis
var express = require('express'),
app = express(),
cookieParser = require('cookie-parser'),
session = require('express-session'),
RedisStore = require('connect-redis')(session);
app.use(express.static(__dirname + '/public'));
app.use(function(req, res, next) {
if (~req.url.indexOf('favicon'))
return res.send(404);
@netcell
netcell / VirtualJoystick
Created April 3, 2015 05:10
Phaser Virtual Joystick
var normalize = Phaser.Point.normalize;
var zero = new Phaser.Point(0, 0);
class Joystick extends Phaser.Sprite {
constructor({x, y, holder, pin}) {
super(game, 0, 0, holder);
this.anchor.setTo(0.5, 0.5);
this.fixedToCamera = true;
this.cameraOffset.setTo(x, y);
@abravalheri
abravalheri / commit.md
Last active June 21, 2024 05:50 — forked from stephenparish/commit.md
RFC: Git Commit Message Guidelines

Commit Message Guidelines

In the last few years, the number of programmers concerned about writing structured commit messages have dramatically grown. As exposed by Tim Pope in article readable commit messages are easy to follow when looking through the project history. Moreover the AngularJS contributing guides introduced conventions that can be used by automation tools to automatically generate useful documentation, or by developers during debugging process.

This document borrows some concepts, conventions and even text mainly from these two sources, extending them in order to provide a sensible guideline for writing commit messages.