Skip to content

Instantly share code, notes, and snippets.

View keddad's full-sized avatar
🥨

Nick keddad

🥨
View GitHub Profile
@veleboks
veleboks / fizbuzz.cpp
Created October 28, 2022 16:24
The scariest fizzbuzz in my life!
/*
* * * * * * * * * * * * * * * * * * * * * * * * *
* *
* .-. *
* .' `. *
* :g g : *
* : o `. *
* : ``. *
* : `. *
@RobbiNespu
RobbiNespu / gist:83ea3f2e1312141e7348dcaef3be1a6c
Created February 15, 2017 01:33
Fedora Android Studio KVM
Kvm
===
Enable kvm virt acceleration for Android Virtual Device emulator
Open Terminal window and type:
- su -c "dnf install @virtualization"
- su -c "systemctl start libvirtd"
Verify that the kvm kernel modules were properly loaded
@sadedv
sadedv / IntegerToBinary.java
Last active February 14, 2024 19:09
Перевести число в различные системы счисления - Java (в шестнадцатиричную, бинарную (двоичную)) Integer to Binary, to Hex and to Octal
public class Main {
public static void main(String[] args) {
Integer number = 255;
// Бинарный формат числа
String convert = Integer.toBinaryString(number);
System.out.println(convert);
// Восьмиричная форма
convert = Integer.toOctalString(number);
@leonjza
leonjza / netcat.py
Last active July 30, 2023 16:28
Python Netcat
import socket
class Netcat:
""" Python 'netcat like' module """
def __init__(self, ip, port):
self.buff = ""
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@lirenlin
lirenlin / gist:9892945
Last active April 21, 2024 17:27
i3 wm, hide window title bar
@aziem
aziem / Emacs Spotify D-Bus
Created October 8, 2013 21:31
Basic elisp to control Spotify
(defun spotify-play () "Play Spotify" (interactive)
(shell-command "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play"))
(defun spotify-pause () "Pause Spotify" (interactive)
(shell-command "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause"))
(defun spotify-playpause () "Play/Pause Spotify" (interactive)
(shell-command "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"))
(defun spotify-next () "Next song in Spotify" (interactive)
@jbonney
jbonney / spotify_keybindings
Created June 9, 2013 13:22
Spotify - Linux key bindings. From XFCE / Ubuntu keyboard shortcuts configuration, assign the control command to their key. http://shkspr.mobi/blog/2011/12/linux-spotify-keybindings/
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious
@jrom
jrom / nginx.conf
Created February 7, 2012 17:14
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";