Skip to content

Instantly share code, notes, and snippets.

View mukhortov's full-sized avatar
:octocat:

Peter Mukhortov mukhortov

:octocat:
View GitHub Profile
@mukhortov
mukhortov / usbreset.c
Last active January 16, 2022 09:02 — forked from x2q/usbreset.c
/* usbreset -- send a USB port reset to a USB device
*
* Compile using: gcc -o usbreset usbreset.c
*
* */
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
@mukhortov
mukhortov / update-dns-record.sh
Last active May 18, 2021 10:51
Automatically update Cloudflare DNS record when the server IP has changed.
#!/bin/bash
#
# Automatically update Cloudflare DNS record when the server IP has changed.
#
# 1. Update params below
#
# 2. Add execute permissions:
# chmod +x ./update-dns-record.sh
#
# 3. To run every hour with cron edit crontab file:
@mukhortov
mukhortov / README.md
Last active April 15, 2024 06:11
Migrate GitHub issues with comments and labels to Jira

Migrate GitHub issues with comments and labels to Jira

Set up the environment

  1. Instal Deno. It's a secure runtime for JavaScript and TypeScript.
  2. Generate a personal access token for GitHub. And save it to ~/.github-oauth. You can use the following command to save it:
    echo generated_github_personal_access_token_goes_here > ~/.github-oauth
@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active July 8, 2024 15:11
Front-end frameworks popularity (React, Vue, Angular and Svelte)
@MatiMax
MatiMax / DNSResolve.swift
Last active November 14, 2016 05:48
This Swift Playground shows how to use Core Foundation's CFHost in Swift 2 to try to produce an array of Strings containing the host name and all its aliases for a given IP address. Unfortunately, CFHostGetNames() does not supply the aliases of a host, so we're left alone with the gethostbyaddr() C function.
//: # How to retrieve a host name and associated aliases from an IP address using Core Fondation's `CFHost`
import Cocoa
import XCPlayground
//: In order to get the callback working we use a simple class to implement the showcase.
class DNSResolve {
//: The IP address may be a Swift `String` thanks to the toll-free bridging to C strings.
let ip: String = "17.172.224.47"
//: We use an optional `CFHost` variable because CFHost neither comes with an initializer nor is conforming to the Nullable protocol.
var host: CFHost?
//: We use this array of `String`s to store the resolved host names.
/* usbreset -- send a USB port reset to a USB device
*
* Compile using: gcc -o usbreset usbreset.c
*
*
* */
@leostratus
leostratus / webkit-pseudo-elements.md
Created September 21, 2012 01:44
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@LeaVerou
LeaVerou / vunits.js
Created November 8, 2011 11:05
Static polyfill for vw, vh, vm units
/**
* Polyfill for the vw, vh, vm units
* Requires StyleFix from -prefix-free http://leaverou.github.com/prefixfree/
* @author Lea Verou
*/
(function() {
if(!window.StyleFix) {
return;
@swider
swider / rotate.less
Created October 6, 2011 22:46
LESS Rotate Mixin for IE
.rotate(@val) {
-moz-transform: rotate(@val); /* FF3.5+ */
-o-transform: rotate(@val); /* Opera 10.5 */
-webkit-transform: rotate(@val); /* Saf3.1+, Chrome */
-ms-transform: rotate(@val); /* IE9 */
transform: rotate(@val);
/* IE6-IE8 */
@radians: ~`parseInt("@{val}") * Math.PI * 2 / 360`;
@costheta: ~`Math.cos("@{radians}")`;
@alexey-bass
alexey-bass / compare.js
Created July 30, 2011 14:03
JavaScript version compare
/**
* Simply compares two string version values.
*
* Example:
* versionCompare('1.1', '1.2') => -1
* versionCompare('1.1', '1.1') => 0
* versionCompare('1.2', '1.1') => 1
* versionCompare('2.23.3', '2.22.3') => 1
*
* Returns: