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
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
public class Main { | |
public static void main(String[] args) { | |
Integer[] array = new Integer[] { 1, 2, 3, 4 }; |
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" | |
) | |
func main() { | |
var arr1 [2]string = [2]string{"A", "B"} | |
var slice1 = arr1[:] | |
slice1[0] = "a" |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import time | |
import sys | |
from subprocess import call | |
cmd = sys.argv | |
t1 = time.perf_counter() | |
call(cmd[1:]) | |
t2 = time.perf_counter() |
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 COLOR | |
----------------- | |
[0;31m => Red | |
----------------- | |
[1;31m => Bold Red | |
----------------- | |
[0;32m => Green | |
----------------- | |
[1;32m => Bold Green | |
----------------- |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
int main(int argc, char const *argv[]) | |
{ | |
char str[] = "Hello World !!!"; | |
int fd = fileno(stdout); | |
FILE *fp = fdopen(fd, "w"); | |
fwrite(str, sizeof(char), sizeof(str), fp); |
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
# send email | |
# To : [email protected] | |
# Subject : empty | |
# Body : get transport obfs4 | |
# torrc example file config | |
UseBridges 1 | |
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy | |
Bridge obfs4 IP:PORT HASH-OF-YOUR-OBFS4-BRIDGE |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <signal.h> | |
volatile sig_atomic_t please_stop; | |
void handler_sigint() | |
{ |
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
char* is a mutable pointer to a mutable character/string. | |
const char* is a mutable pointer to an immutable character/string. You cannot change the contents of the location(s) this pointer points to. Also, compilers are required to give error messages when you try to do so. For the same reason, conversion from const char * to char* is deprecated. | |
char* const is an immutable pointer (it cannot point to any other location) but the contents of location at which it points are mutable. | |
const char* const is an immutable pointer to an immutable character/string. |
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
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig | |
# in fish shell | |
echo (pkg-config libcpuid --cflags --libs) | xargs gcc main.c -o program | |
# in zsh or bash shell | |
gcc main.c -o program `pkg-config libcpuid --cflags` | |
export LD_LIBRARY_PATH=/usr/local/lib/ | |
# run program | |
./program |
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
#include <stdio.h> | |
#define MULTI(x) (x * 2) | |
int main() { | |
printf("%d \n", MULTI(3 + 3)); | |
return 0; | |
} |