Skip to content

Instantly share code, notes, and snippets.

Vinicius Jarina viniciusjarina

View GitHub Profile
View test.linux.luac
1B 4C 75 61 03 F8 00 19 93 0D 0A 1A 0A 04 08 08 78 56 00 00 00 00 00 00 .Lua.ø..“.......xV......
00 00 00 00 00 28 77 40 01 8A 40 74 65 73 74 2E 6C 75 61 80 80 00 .....(w@.Š@ test.lua€€.
01 02 96 51 00 00 00 0F 80 00 01 0F 80 02 03 0F 80 04 05 13 00 03 00 52 ..–Q....€...€...€......R
00 00 00 12 80 07 01 12 80 08 09 12 80 0A 0B 0F 00 06 00 13 00 02 00 52 ....€...€...€..........R
00 00 00 93 00 02 00 52 00 00 00 92 80 0E 0F 92 80 10 10 12 00 0D 01 12 ...“...R...’€..’€.......
80 11 11 0F 00 0C 00 4F 00 00 00 0F 00 12 00 46 00 01 01 93 04 86 77 69 €......O.......F...“.†wi
64 74 68 03 64 00 00 00 00 00 00 00 04 87 68 65 69 67 68 74 03 C8 00 00 dth.d........‡height.È..
00 00 00 00 00 04 88 6D 65 73 73 61 67 65 04 8D 48 65 6C 6C 6F 20 57 6F ......ˆmessage. Hello Wo
72 6C 64 21 04 86 63 6F 6C 6F 72 04 82 72 04 82 67 03 14 00 00 00 00 00 rld!.†color.‚r.‚g.......
00 00 04 82 62 03 32 00 00 00 00 00 00 00 04 85 74 72 65 65 04 88 62 72 ...‚b.2........…tree.ˆbr
View test.windows.luac
B 4C 75 61 03 F8 00 19 93 0D 0A 1A 0A 04 08 08 78 56 00 00 00 00 00 00 .Lua.ø..“.......xV......
00 00 00 00 00 28 77 40 01 8C 40 2E 5C 74 65 73 74 2E 6C 75 61 80 80 00 .....(w@.Œ@.\test.lua€€.
01 02 96 51 00 00 00 0F 80 00 01 0F 80 02 03 0F 80 04 05 13 00 03 00 52 ..–Q....€...€...€......R
00 00 00 12 80 07 01 12 80 08 09 12 80 0A 0B 0F 00 06 00 13 00 02 00 52 ....€...€...€..........R
00 00 00 93 00 02 00 52 00 00 00 92 80 0E 0F 92 80 10 10 12 00 0D 01 12 ...“...R...’€..’€.......
80 11 11 0F 00 0C 00 4F 00 00 00 0F 00 12 00 46 00 01 01 93 04 86 77 69 €......O.......F...“.†wi
64 74 68 03 64 00 00 00 00 00 00 00 04 87 68 65 69 67 68 74 03 C8 00 00 dth.d........‡height.È..
00 00 00 00 00 04 88 6D 65 73 73 61 67 65 04 8D 48 65 6C 6C 6F 20 57 6F ......ˆmessage. Hello Wo
72 6C 64 21 04 86 63 6F 6C 6F 72 04 82 72 04 82 67 03 14 00 00 00 00 00 rld!.†color.‚r.‚g.......
00 00 04 82 62 03 32 00 00 00 00 00 00 00 04 85 74 72 65 65 04 88 62 72 ...‚b.2........…tree.ˆbr
View test.lua
width=100
height=200
message="Hello World!"
color={r=100,g=20,b=50}
tree={branch1={leaf1=10,leaf2="leaf2"},leaf3="leaf3"}
function func(x,y)
return x,x+y
end
@viniciusjarina
viniciusjarina / # Use_VS2017_WindowsTerminal.md
Last active Mar 11, 2020
Using Visual Studio 2017 From Windows Terminal
View # Use_VS2017_WindowsTerminal.md

Using Visual Studio 2017 From Windows Terminal

VS 2017 doens't provide a PowerShell module like VS 2019. To make it work we need to do an small hack using VsDevCmd.bat to export VSDevCmd env vars to PowerShell

Save the VS2017.ps1 and add a new profile to the profiles.json

"commandline": "powershell.exe -NoExit -Command \". { . C:\\Users\\vinja\\Documents\\WindowsPowerShell\\VS2017.ps1 }\""
@viniciusjarina
viniciusjarina / VS2017.ps1
Created Mar 11, 2020
VS2017.ps1 to export VSDevCmd env vars to PowerShell
View VS2017.ps1
pushd "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools"
cmd /c "VsDevCmd.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
View VSCodeSettings.json
{
"editor.fontSize": 16,
"editor.renderWhitespace": "all",
"workbench.colorTheme": "Visual Studio Light",
"editor.renderControlCharacters": true,
"workbench.editor.enablePreview": false
}
@viniciusjarina
viniciusjarina / PSProfile.ps1
Last active Jan 26, 2020
~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
View PSProfile.ps1
Set-Alias -Name "open" -Value "explorer"
Import-Module 'C:\Users\vinic\posh-git\posh-git\src\posh-git.psd1'
#Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevshell\Microsoft.VisualStudio.DevShell.dll'
#& { Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevshell\Microsoft.VisualStudio.DevShell.dll'; Enter-VsDevShell -InstanceId bd6d43cd}
Import-Module 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevshell\Microsoft.VisualStudio.DevShell.dll'
Enter-VsDevShell -InstanceId bd6d43cd
# Settings for the prompt are in GitPrompt.ps1, so add any desired settings changes here.
# Example:
cd ~\projects\
View LargestRectangle.cpp
// largestRectangle.cpp : Defines the entry point for the console application.
//
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <algorithm>
using namespace std;
View base_encoder.py
""" base_x.py
Encoding to, and decoding from, "any" numerical base. Using the Encoder
class, converters for base 16, 8, 2 etc. can easily be defined, but
uncommon bases like 13, 29 or 62 are just as easy. The user can also
provide his own string with "numbers".
24 Dec 98 Creation. [HN]
08 Jan 99 Added BinaryEncoder, btoi, itob.
11 Jan 99 Encoder.__init__: basestr now has default value.
View cellid_2_pos.py
#Begin
#!/usr/local/bin/python
#import httplib
import urllib
from google.appengine.api import urlfetch
from struct import *
def cellid_2_pos(cellid, lac, mnc = 0, mcc = 0):
You can’t perform that action at this time.