This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//JavaScript object | |
const myData={"id":1,"name":"Adrian","info":"My %website% is https://adrian.me"} | |
//Encode the data into JSON format, as a string | |
const asText=JSON.stringify(myData) | |
//encode the JSON string in Base64 for better transportation, like an envelope for a letter | |
//https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding | |
const asBinary=window.btoa(asText) | |
//create an URL and encode it | |
const url=encodeURI("https://httpbin.org/get?user="+asBinary) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"the letters "a" and "b" (lowercase) in different character formats: | |
A_HTML_ENTITY="a" | |
A_ASCII_DECIMAL=97 | |
B_HTML_ENTITY="b" | |
B_ASCII_DECIMAL=98 | |
#the strings "a" and "b" encoded in base64 | |
A_BASE64="YQ==" | |
B_BASE64="Yg==" | |
#"a" and "b" encrypted with the Blowfish algorithm (password "aaaa") in hexa | |
A_BLOWFISH="c2d15a8c28974fa4" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd c: && \ | |
wget -O "msys.7z" "https://sourceforge.net/projects/mingwbuilds/files/external-binary-packages/msys%2B7za%2Bwget%2Bsvn%2Bgit%2Bmercurial%2Bcvs-rev13.7z/download" --no-check-certificate && \ | |
unzip msys.7z && \ | |
mkdir c:\msys\mingw && \ | |
echo "C:/MinGW-W64/mingw64 /mingw" >> "C:\msys\etc\fstab" && \ | |
wget -O "C:\msys\bin\yasm.exe" "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win64.exe" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var currentYear = 2017 | |
//private function, fetch from DB | |
function getTodos() { | |
return [ | |
{ name: "boogy", checked: true, year: 2014 }, | |
{ name: "alfa", checked: false, year: 2017 }, | |
{ name: "back to the future", checked: false, year: 2021 }, | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/BTooLs/data-structures/priorityqueue" | |
) | |
func main() { | |
autoLockMutex := false | |
var lowestPriority uint8 = 10 //highest is 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code --list-extensions | |
bierner.markdown-preview-github-styles | |
codezombiech.gitignore | |
dbaeumer.vscode-eslint | |
dimasalmaz.unity3d-pack | |
donjayamanne.javadebugger | |
hnw.vscode-auto-open-markdown-preview | |
jorgeserrano.vscode-csharp-snippets | |
k--kato.docomment | |
k--kato.intellij-idea-keybindings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace interpolation | |
{ | |
class Program | |
{ | |
//usage: dotnet run 1 2 3 4 7 10 13 | |
static void Main(string[] args) | |
{ | |
//pseudocode https://www.tutorialspoint.com/data_structures_algorithms/interpolation_search_algorithm.htm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//given an array arr, you have to return the amount of numbers that are smaller than arr[i] to the right. | |
// BSTree, complexity O(n squared) | |
var smaller = function (nums) { | |
var res = [], count = 0, i = nums.length - 2,thisCount = 0; | |
if (nums == null || nums.length == 0) return res; | |
var root = NewTreeNode(nums[nums.length - 1]); | |
res.push(0); | |
for (; i >= 0; i--) { | |
res.push(insertNodeAndCount(root, nums[i])); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#go to source | |
find . -type d -print0 > dirs.txt | |
#go to destination | |
xargs -0 mkdir -p < dirs.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//paths for meteor and node | |
@import "../../../node_modules/bootstrap/scss/mixins"; | |
@import "../../../node_modules/bootstrap/scss/utilities"; | |
@import "../../../node_modules/bootstrap/scss/buttons"; | |
//example screenshot https://twitter.com/B3aT/status/864809895249555458 | |
//I wanted the Active button to be bigger, but the react-pagination doesn't externalize the | |
//active - Link property, so this is a css workaround | |
//also it makes a fade-out for non-clickable elements |