Skip to content

Instantly share code, notes, and snippets.

View moughamir's full-sized avatar
:shipit:
Inspecting elements

Mohamed Moughamir moughamir

:shipit:
Inspecting elements
View GitHub Profile
<!-- This is a Node+WebSocket powered demo to sync videos
across different browsers. This file is the client,
the other one is the Node server. Powered by Node and
http://github.com/miksago/node-websocket-server -->
<style>
.inactive { display: none; }
.active { display: block; }
</style>
<script>
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType font/x-woff .woff
AddType image/svg+xml .svg
# Compress compressible fonts
AddOutputFilterByType DEFLATE font/ttf font/otf image/svg+xml
@cyakimov
cyakimov / gist:1049915
Created June 27, 2011 21:41
CentOS / Fedora 'build-essential' equivalent
yum groupinstall "Development Tools"
@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
/* Arduino USB Keyboard HID demo
* Cut/Copy/Paste Keys
*/
#define KEY_LEFT_CTRL 0x01
#define KEY_LEFT_SHIFT 0x02
#define KEY_RIGHT_CTRL 0x10
#define KEY_RIGHT_SHIFT 0x20
uint8_t buf[8] = {
@umutakturk
umutakturk / php_mongodb_simple_pagination.php
Created September 29, 2012 19:01
PHP MongoDB Simple Pagination
<?php
$mongodb = new Mongo("mongodb://username:password@localhost/database_name");
$database = $mongodb->database_name;
$collection = $database->collection;
$page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
$limit = 12;
$skip = ($page - 1) * $limit;
$next = ($page + 1);
$prev = ($page - 1);
@damirhasakovic
damirhasakovic / muttrc
Created October 6, 2012 09:09
My Mutt config
# Paths ----------------------------------------------
set realname = "Damir Hasakovic"
set imap_user = '[email protected]'
set from = "[email protected]"
set spoolfile = imaps://imap.gmail.com:993/INBOX
set smtp_url = "smtp://[email protected]@smtp.gmail.com:587/"
set folder = "imaps://imap.gmail.com:993"
set record="+[Gmail]/Sent Mail"
set postponed="+[Gmail]/Drafts"
set header_cache = ~/.mutt/cache/headers # store headers
@sstelfox
sstelfox / gist:4709573
Created February 4, 2013 20:40
Linux version of the imagesnap post-commit git hooks. To use create the file .git/hooks/post-commit in any repository you commit in often. Requires you have fswebcam installed (most distros have a package for it). Snapshots are stored in ~/.gitshots.
#!/usr/bin/env ruby
#
require 'fileutils'
fswebcam_path = `which fswebcam`.strip
exit 0 if fswebcam_path.empty?
print "Snapshotting your pretty mug..."
@kladov
kladov / getZodiacSign.js
Last active October 17, 2023 04:39
Zodiac sign (javascript)
/**
* Return zodiac sugn by month and day
*
* @param day
* @param month
* @return {string} name of zodiac sign
*/
function getZodiacSign(day, month) {
var zodiacSigns = {
@phucat
phucat / app.js
Last active February 27, 2022 02:00
Playing with Node.js and Socket.IO. Testing of socket emit and video, audio streaming.
var app = require('express')(),
server = require('http').createServer(app),
io = require('socket.io').listen(server),
fs = require('fs'),
util = require('util');
server.listen(8080);
// set transport fallback order
io.set('transports', [