Skip to content

Instantly share code, notes, and snippets.

View deviantfero's full-sized avatar

Fernando Vásquez deviantfero

  • Santa Tecla, El Salvador
View GitHub Profile
@deviantfero
deviantfero / solarized-wal.sh
Created September 19, 2019 19:54
sequences
]4;0;#073642\]4;1;#dc322f\]4;2;#859900\]4;3;#b58900\]4;4;#268bd2\]4;5;#d33682\]4;6;#2aa198\]4;7;#eee8d5\]4;8;#6c7c80\]4;9;#dc322f\]4;10;#859900\]4;11;#b58900\]4;12;#268bd2\]4;13;#d33682\]4;14;#2aa198\]4;15;#eee8d5\]10;#fdf6e3\]11;#073642\]12;#dc322f\]13;#fdf6e3\]17;#fdf6e3\]19;#073642\]4;232;#073642\]4;256;#fdf6e3\]708;#073642\
(defun my/activate-tide-mode ()
"Use hl-identifier-mode only on js or ts buffers."
(when (and (stringp buffer-file-name)
(string-match "\\.[tj]sx?\\'" buffer-file-name))
(tide-setup)
(tide-hl-identifier-mode)))
(defun my/set-local-eslint ()
"Use local node_modules."
(add-node-modules-path)
;;; wpgtk-theme.el --- Dynamic color theme, specially made for wpgtk
;; based on: <https://github.com/warreq/xres-theme>
;;
;; Version: 0.1
;; Keywords: color, theme
;; Package-Requires: ((emacs "24"))
;; Initially with the help of emacs-theme-generator, <https://github.com/mswift42/theme-creator>.
;; Modified directly from Nasser Alshammari's spacemacs theme
;;;; OPEN MUPDF WITH DOCUMENT
;;;; CORRELATE MODE ASKS FOR THE MAIN FILE IN EACH NEW FILE :)
(use-package tex
:ensure auctex
:config
(use-package latex
:config
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
import sys
for l in sys.stdin:
inp = [int(x) for x in l.split(' ')]
a = int(inp[0] / inp[1]) if inp[1] != 0 else 0
t = 2 * inp[1]
print(inp[0] * t + a * inp[1]**2)
@deviantfero
deviantfero / 10300.cc
Last active May 19, 2018 07:45
solution to problem 10300 in C++
#include <algorithm>
#include <iostream>
#include <vector>
int main() {
int area, friendliness, animals;
int tests, farmers, aux = 0;
std::vector<int> debt;
std::cin >> tests;
companion object {
  // Other static constants
private val executor = Executors.newSingleThreadExecutor()
}
private fun onStatusChanged(newStatus: VideoCallStatus) {
Log.d(TAG,"New call status: $newStatus")
runOnUiThread {
when(newStatus) {
VideoCallStatus.FINISHED -> finish()
else -> {
statusTextView?.text = resources.getString(newStatus.label)
statusTextView?.setTextColor(ContextCompat.getColor(this, newStatus.color))
setContentView(R.layout.activity_video_call)
statusTextView = findViewById(R.id.status_text)
localVideoView = findViewById(R.id.pip_video)
remoteVideoView = findViewById(R.id.remote_video)
val hangup : ImageButton = findViewById(R.id.hangup_button)
hangup.setOnClickListener {
finish()
}
type MatchMessage = {
type: MessageType.MATCHED
match: string
offer: boolean
}
type SDPMessage = {
type: MessageType.SDP
sdp: string
}