Skip to content

Instantly share code, notes, and snippets.

View lossurdo's full-sized avatar

Rafael Lossurdo lossurdo

View GitHub Profile
local function testHTTP()
net.dns.resolve("www.google.com", function(sk, ip)
if ip == nil then
print("DNS fail!")
else
print("Resolved: " .. ip)
end
end)
http.get("http://httpbin.org/ip", nil, function(code, data, result)
@DecisionNerd
DecisionNerd / csv2json.sh
Created November 13, 2015 03:13
CSV to JSON converter using BASH. Original script from http://blog.secaserver.com/2013/12/convert-csv-json-bash/
#!/bin/bash
# CSV to JSON converter using BASH
# original script from http://blog.secaserver.com/2013/12/convert-csv-json-bash/
# thanks SecaGuy!
# Usage ./csv2json.sh input.csv > output.json
input=$1
[ -z $1 ] && echo "No CSV input file specified" && exit 1
[ ! -e $input ] && echo "Unable to locate $1" && exit 1
@massahud
massahud / Portable Node.js andNPM on windows.md
Last active February 8, 2024 14:30
Portable Node.js and NPM on windows
  1. Get node binary (node.exe) from http://nodejs.org/download/
  2. Create the folder where node will reside and move node.exe to it
  3. Download the last zip version of npm from http://nodejs.org/dist/npm
  4. Unpack the zip inside the node folder
  5. Download the last tgz version of npm from http://nodejs.org/dist/npm
  6. Open the tgz file and unpack only the file bin/npm (without extension) directly on the node folder.
  7. Add the the node folder and the packages/bin folder to PATH
  8. On a command prompt execute npm install -g npm to update npm to the latest version

Now you can use npm and node from windows cmd or from bash shell like Git Bash of msysgit.

@DarrylD
DarrylD / paste-image.html
Created November 7, 2013 16:09
Demo of simple way to paste ( ctrl+v ) from clipboard.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Paste image from clipboard in Chrome</title>
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script>
//plugin for pasting from https://gist.github.com/STRd6/5286415
(function($) {
// plugin by STRd6
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@pksunkara
pksunkara / config
Last active April 17, 2024 05:47
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta