Skip to content

Instantly share code, notes, and snippets.

View YugalXD's full-sized avatar
💭
yugalxd@github:~$ profile

Yugal Yadav YugalXD

💭
yugalxd@github:~$ profile
View GitHub Profile
@leommoore
leommoore / mongodb_setting_up_a_replica_set.md
Last active December 8, 2021 09:58
MongoDB - Setting up a Replica Set

#MongoDB - Setting up a Replica Set

cd \mongodbdir\

mkdir db1
mkdir db2
mkdir db3

###Primary mongod --dbpath ./db1 --port 30000 --replSet "demo"

@prime31
prime31 / gist:5675017
Last active May 28, 2024 11:37
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@dduan
dduan / gist:2708979
Created May 16, 2012 09:15
Convert web pages to PDF using Python + QtWebkit
# Authored by sundance@ierne.eu.org as found in the following link:
# http://www.mail-archive.com/pyqt@riverbankcomputing.com/msg18928.html
import sys
from PyQt4 import QtCore
from PyQt4 import QtGui
from PyQt4.QtCore import QObject
from PyQt4.QtCore import QUrl
from PyQt4.QtCore import QSizeF