Skip to content

Instantly share code, notes, and snippets.

View gokaybiz's full-sized avatar
🌪️
Focusing

gokaybiz

🌪️
Focusing
View GitHub Profile
@gerner
gerner / gist:8201345
Created December 31, 2013 19:46
Hex decoding/encoding
public class HexDecoder {
//lower ascii only
private static int[] HEX_TO_INT = new int[] {
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, //0-15
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, //16-31
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, //32-47
0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1, //48-63
-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, //64-79
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, //80-95
#! /usr/bin/python
# by pts@fazekas.hu at Tue Oct 11 13:12:47 CEST 2016
""":" #megapubdl: Download public files from MEGA (mega.nz).
type python2.7 >/dev/null 2>&1 && exec python2.7 -- "$0" ${1+"$@"}
type python2.6 >/dev/null 2>&1 && exec python2.6 -- "$0" ${1+"$@"}
type python2.5 >/dev/null 2>&1 && exec python2.5 -- "$0" ${1+"$@"}
type python2.4 >/dev/null 2>&1 && exec python2.4 -- "$0" ${1+"$@"}
exec python -- ${1+"$@"}; exit 1
/**
* coder: kodo no kami
* face: www.facebook.com/hacker.fts315
* date: 21/04/2015
**/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv){
@asukakenji
asukakenji / try_shiny_2.go
Last active February 17, 2020 01:19
Shortest GUI program written in Golang. It displays a window and exits when the "close" button of the window is clicked.
// Shortest GUI program written in Golang.
// It displays a window and exits when the "close" button of the window is clicked.
package main
import (
"golang.org/x/exp/shiny/driver"
"golang.org/x/exp/shiny/screen"
// Despite that the package names have a "mobile" prefix,
// these packages works on desktop.
@chrishuan9
chrishuan9 / Hex2StringMain.java
Created April 17, 2012 20:47
Convert String to Hex and Hex to String
import java.io.UnsupportedEncodingException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author EtaYuy88
*/
public class Main {
@hunsiri
hunsiri / my.cnf
Created June 26, 2020 03:58 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated January 2020 ~
#
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@aungmyatmoethegreat
aungmyatmoethegreat / useFetchApi.js
Created May 28, 2022 07:11
Using custom hook/composable to fetch data in nuxt3
/**
* It takes a URL and options, and returns a response object
* @param url - The URL to fetch.
* @param [options] - The options object that will be passed to the fetch function.
* @returns The return value of the useFetch hook.
*/
import {useFetch, useRuntimeConfig} from "nuxt/app";
export default function useFetchApi(url, options = {}) {
const config = useRuntimeConfig();
@miguelmota
miguelmota / index.js
Created December 20, 2016 19:42
Node.js equivalent of Python's if __name__ == '__main__'
function main() {}
if (require.main === module) {
main();
}
@AssisrMatheus
AssisrMatheus / #vscode-setup.md
Last active January 7, 2024 14:06
My optimized Visual Studio Code setup
@henriquemoody
henriquemoody / http-status-codes.php
Last active January 26, 2024 10:29
List of HTTP status codes in PHP
<?php
/**
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
*
* You may also want a list of unofficial codes:
*
* 103 => 'Checkpoint',
* 218 => 'This is fine', // Apache Web Server
* 419 => 'Page Expired', // Laravel Framework