Skip to content

Instantly share code, notes, and snippets.

View reklatsmasters's full-sized avatar

Dmitriy Tsvettsikh reklatsmasters

  • Perm, Russia
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active May 4, 2024 15:48
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@Randl
Randl / fast_fibo.h
Created February 14, 2017 12:40
Calculate nth Fibonacci number
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <gmp.h>
/*
* from Fibo(n) = phi^n / sqrt(5) approximate number of bits in nth fibo
* is log_2(phi) * n - log_2(5)/2 For n >> 1, it's a bit less than 0.695n
*/
#define FIBO_BITCOUNT(x) ((mp_bitcnt_t)ceil(0.695 * (x)))
@Ashwinning
Ashwinning / EnableDisableHyperV.md
Created June 9, 2016 00:22
Powershell scripts to enable disable Hyper-V.

Open Powershell as admin

To Enable

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V –All

To Disable

Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
@Jxck
Jxck / dtls_api.md
Created May 24, 2016 08:21
OpenSSL DTLS API

OpenSSL DTLS API

The API used for DTLS is mostly the same as for TLS, because of the mapping of generic functions to protocol specifc ones. Some additional functions are still necessary, because of the new BIO objects and the timer handling for handshake messages. The generic concept of the API is described in the following sections. Examples of applications using DTLS are available at [9].

DTLS の API は TLS とほぼ同じ。 BIO オブジェクトの生成とタイマのために追加でいくつか必要。

_log_pskb(date_created,link_id,logname,log)
account(id,uid,sum)
account_attach(account_id,file_id,name,orig_name)
account_transaction(user_id,yd)
activate_service(code,email,data)
admin_log_users(user_id,log_id,last_comment_view)
annoy(ip,last_req)
articles(title,short,msgtext,sign,logo,link)
articles_comments(from_id,parent_id,from_ip,created_time,article_id,msgtext,youtube_link)
articles_comments_files(comment_id,file_id,small,inline,temp)
@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@idleberg
idleberg / DropboxIgnore.md
Last active June 4, 2023 12:02
Ignore node_modules/bower_components folders in your Dropbox

This script scans your Dropbox (or any given folder) for folders stored in the ignore array and excludes them from syncing. Makes use of the official Dropbox CLI

I'm a beginner at bash, so all improvements are welcome!

#!/bin/bash

set -e

# SETTINGS
@pepelsbey
pepelsbey / hocus.scss
Last active March 1, 2024 11:03
Simple “Hocus” Sass @mixin for :hover and :focus pseudos. Makes them easier to write and you’ll never forget to specify both.
@mixin hocus {
&:hover,
&:focus {
@content;
}
}
// Before
E {
&:hover,
@rxaviers
rxaviers / gist:7360908
Last active May 4, 2024 22:00
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: