Skip to content

Instantly share code, notes, and snippets.

View duduindo's full-sized avatar
🏊‍♀️
beach ❤️

Eduardo Paixão duduindo

🏊‍♀️
beach ❤️
View GitHub Profile
@soheilhy
soheilhy / nginxproxy.md
Last active April 11, 2025 06:29
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@rxaviers
rxaviers / gist:7360908
Last active May 4, 2025 18:37
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:
@quitschibo
quitschibo / testMocks.js
Last active July 21, 2023 17:25
How to mock jQuery calls with Jasmine. Just some examples ;)
describe('Mock jQuery calls with Jasmine', function() {
it('how to mock $("test").show()', function() {
// mock the call
spyOn($.fn, 'show').andCallFake(function() {
return true;
});
// now we can call the mock
result = $("test").show();
@0xjjpa
0xjjpa / communication.js
Created December 26, 2012 19:15
Basic communication between a Background Page and a Content Script inside a Chrome Extension.
// In Background.js
chrome.tabs.sendMessage(tab.id, {content: "message"}, function(response) {
if(response) {
//We do something
}
});
// In ContentScript.js
chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
if(request.content) {
@dhavaln
dhavaln / filesystem.js
Created June 8, 2012 08:51
PhoneGap Filesystem Example
/**
* Prepare the App Folder
*/
(function(){
window.appRootDirName = ".myapp";
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log("device is ready");
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
@leobetosouza
leobetosouza / gist:2856498
Created June 2, 2012 04:00
JavaScript Design Patterns Hangout
Links, livros, artigos e etc comentados durante o Hangout 'JavaScript e Design Patterns': http://youtu.be/FkED71eM7s8
@subimage
subimage / array_chunk.js
Created April 19, 2012 06:50
Javascript array chunk
// Splits an array into equal sized chunks
Array.prototype.chunk = function(pieces) {
pieces = pieces || 2;
var len = this.length;
var mid = (len/pieces);
var chunks = [];
var start = 0;
for(var i=0;i<pieces;i++) {
var last = start+mid;
if (!len%pieces >= i) {