Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/bash
####displays the translation
text="$@"
if [[ "$text" =~ ^[a-z] ]];then
translate="$(wget -U "Mozilla/5.0" -qO - "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=fa&dt=t&q=$(echo $text | sed "s/[\"'<>]//g")" | sed "s/,,,0]],,.*//g" | awk -F'"' '{print $2, $6}')"
else
translate="$(wget -U "Mozilla/5.0" -qO - "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=en&dt=t&q=$(echo $text | sed "s/[\"'<>]//g")" | sed "s/,,,0]],,.*//g" | awk -F'"' '{print $2, $6}')"
fi
@LinArcX
LinArcX / scrolling_form.c
Created August 12, 2019 14:08 — forked from alan-mushi/scrolling_form.c
This is a simple example of "scrolling" form with ncurses. It use "page" to allow forms with more fields than your window can print.
/*
* This is a simple example of "scrolling" form with ncurses.
* It use "page" to allow forms with more fields than your window can print.
*
* It prints a "label" (inactive field) and a regular field and let you
* "scroll" pages of the form.
*
* How to compile:
* gcc -o test scrolling_form.c -lform -lncurses
*/
#include <gtk/gtk.h>
void close_window(GtkWidget* widget, gpointer data)
{
gtk_window_close(widget);
}
void show_simple_window()
{
GtkApplication* app;
# This file was generated by Tor; if you edit it, comments will not be preserved
# The old torrc file was renamed to torrc.orig.1 or similar, and Tor will ignore it
# Where to send logging messages. Format is minSeverity[-maxSeverity]
# (stderr|stdout|syslog|file FILENAME).
Log notice stdout
CookieAuthentication 1
DormantCanceledByStartup 1
#Log notice file E:\tor\Browser\TorBrowser\Tor\notice.log
#!/bin/bash
# Compile curl for android with NDK.
# Copyright (C) 2019 linarcx <linarcx@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
"-------------------------------------------------------"
function! CreateCenteredFloatingWindow()
let width = min([&columns - 4, max([80, &columns - 20])])
let height = min([&lines - 4, max([20, &lines - 10])])
let top = ((&lines - height) / 2) - 1
let left = (&columns - width) / 2
let opts = {'relative': 'editor', 'row': top, 'col': left, 'width': width, 'height': height, 'style': 'minimal'}
let top = "╭" . repeat("─", width - 2) . "╮"
let mid = "│" . repeat(" ", width - 2) . "│"
@LinArcX
LinArcX / repo-reset.md
Created March 7, 2020 09:23 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
let
pkgs = import <nixpkgs> {};
in
pkgs.mkShell {
buildInputs = [
pkgs.cmake
pkgs.clang
pkgs.clang-analyzer
];
shellHook = ''