Skip to content

Instantly share code, notes, and snippets.

View JosielFaleiros's full-sized avatar
🏠
Working from home

Josiel Faleiros Alves JosielFaleiros

🏠
Working from home
  • Brazil
View GitHub Profile
@parth1020
parth1020 / Google Maps Simple Multiple Marker Example
Created January 8, 2013 07:04
Google Maps Simple Multiple Marker Example
<html>
<head>
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
</head>
<body>
<div id="map" style="height: 400px; width: 500px;">
</div>
<script type="text/javascript">
@Integralist
Integralist / 1. Template.feature
Last active March 18, 2021 22:05
[Cucumber Gherkin Template Feature File] #gherkin #cucumber #userstory #story #feature #scenario
Feature: <title>
In order to <do something>
As a <user>
I want to <achieve some goal>
Scenario: <title>
<additional description>
@fsodogandji
fsodogandji / socat-tips.sh
Last active April 11, 2024 18:47
socat tips & tricks
#To create a classic TCP listening daemon, similar to netcat -l, use a variation of the following command.
socat TCP-LISTEN:8080 stdout
#use remotly a command shell
socat TCP4-LISTEN:1234,reuseaddr,fork 'SYSTEM:/bin/cat /home/infos.txt'
#sslify a server
socat OPENSSL-LISTEN:443,reuse‐addr,pf=ip4,fork,cert=server.pem,cafile=client.crt TCP4-CONNECT:localhost:80
@kelvinn
kelvinn / cmd.sh
Created July 24, 2014 02:55
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@madhums
madhums / base64-image-upload.js
Created September 14, 2014 17:37
save base64 encoded image
/*
* Taken from http://stackoverflow.com/questions/5867534/how-to-save-canvas-data-to-file/5971674#5971674
*/
var fs = require('fs');
// string generated by canvas.toDataURL()
var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0"
+ "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO"
+ "3gAAAABJRU5ErkJggg==";
// strip off the data: url prefix to get just the base64-encoded bytes
@ZevEisenberg
ZevEisenberg / resetAllSimulators.sh
Last active June 20, 2024 17:13
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
@tracker1
tracker1 / 01-directory-structure.md
Last active June 17, 2024 15:54
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@aalvesjr
aalvesjr / tmux-atalhos.md
Last active January 30, 2023 22:44
[TMUX] Atalhos

quando ler <Prefix> será o padrão Ctrl + b

Window

  • <Prefix> c => para criar uma nova 'window'
  • <Prefix> % => para dividir uma 'window' verticalmente
  • <Prefix> " => para dividir uma 'window' horizontalmente
  • <Prefix> & => para fechar uma 'window'
  • <Prefix> . => move a window para algum indice ainda não utilizado
  • <Prefix> 0 a 9 => abre a 'window' com o numero digitado
  • \ w => abre a 'window' a partir de uma lista
@leommoore
leommoore / mongodb_3.2.x_logging.md
Last active July 4, 2021 10:51
MongoDB 3.2.x Logging

MongoDB 3.2.x Logging

The main log file is the mongod.log. You can specify the log file location when you are starting the mongod process but if you have installed on Ubuntu from a package then you log file will normally be located in /var/log/mongodb/mongod.log.

You can tail the log file using:

tail -f /var/log/mongodb/mongod.log

From the Mongo shell you can also view the log file using:

show logs

@jcward
jcward / Readme.txt
Created April 14, 2017 15:08
Generating iOS P12 / certs without Mac OSX Keychain (on linux, windows, etc)
1) Generate a private key and certificate signing request:
openssl genrsa -out ios_distribution.key 2048
openssl req -new -key ios_distribution.key -out ios_distribution.csr -subj '/emailAddress=me@example.com, CN=Example, C=US'
2) Upload CSR to apple at: https://developer.apple.com/account/ios/certificate/create
- choose Production -> App Store and Ad Hoc
3) Download the resulting ios_distribution.cer, and convert it to .pem format: