Skip to content

Instantly share code, notes, and snippets.

View 7flash's full-sized avatar
🎯
Focusing

Igor Berlenko 7flash

🎯
Focusing
  • Telegram @galaxygur
View GitHub Profile
@soarez
soarez / ca.md
Last active October 29, 2024 18:12
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@pastleo
pastleo / index.js
Created May 28, 2016 06:31
freecodecamp crawler using promise, generator and coroutine
var request = require('request-promise');
var co = require('co');
var fs = require('fs');
var cheerio = require('cheerio');
var dateFormat = require('dateformat');
var usernames = ['jd615645', 'jayhung97724'];
var fcc_info = [];
@artjomb
artjomb / CryptoJS_byteArrayWordArrayConversions.js
Last active January 9, 2024 16:43
Convert a byte array to a word array and back in CryptoJS-compatible fashion
function byteArrayToWordArray(ba) {
var wa = [],
i;
for (i = 0; i < ba.length; i++) {
wa[(i / 4) | 0] |= ba[i] << (24 - 8 * i);
}
return CryptoJS.lib.WordArray.create(wa, ba.length);
}
@hiiamyes
hiiamyes / use-asyncawait.js
Created September 13, 2016 17:36
bed crawler
let moment = require('moment');
let cheerio = require('cheerio');
let async = require('asyncawait/async');
let await = require('asyncawait/await');
let rp = require('request-promise');
const URL = 'https://npm.cpami.gov.tw/bed_1.aspx';
const getASPState = () => {
return new Promise( (resolve, reject) => {
@jameswomack
jameswomack / npm-update.js
Created October 13, 2016 19:40
Building an npm update string generator
function makeObjectIterable (foo) {
foo[Symbol.iterator] = function* () {
yield* Object.keys(foo).map(function (name) {
return [name, foo[name]]
})
}
return foo
}
@GLMeece
GLMeece / latency_numbers.md
Last active May 22, 2024 15:57
Latency Numbers Every Programmer Should Know - MarkDown Fork

Latency Comparison Numbers

Note: "Forked" from Latency Numbers Every Programmer Should Know

Event Nanoseconds Microseconds Milliseconds Comparison
L1 cache reference 0.5 - - -
Branch mispredict 5.0 - - -
L2 cache reference 7.0 - - 14x L1 cache
Mutex lock/unlock 25.0 - - -
@marjoballabani
marjoballabani / Nodejs-deap-learning.md
Last active November 17, 2017 14:54
Nodejs in deep

Nodej in deep

This article is for those who have basic knowledge of javascript

Javascript aside

Javascript thinks you should know to make sure you understand nodejs properly

  1. With functions you can do everythink you can do with other types because functions are First-Type
  2. Objects are a collection of name/value pairs
@creotip
creotip / installApps.sh
Created November 4, 2017 11:09 — forked from anonymous/installApps.sh
Solus OS Automatic installation of stuff for developers
sudo eopkg install -y git
sudo eopkg install -y atom
sudo eopkg it gnome-tweak-tool
apm install color-picker file-icons minimap
apm install linter-csslint linter-eslint linter-js-yaml
sudo eopkg it -y neofetch
sudo eopkg bi --ignore-safety https://raw.githubusercontent.com/solus-project/3rd-party/master/network/web/browser/google-chrome-stable/pspec.xml
sudo eopkg it -y google-chrome-*.eopkg;sudo rm google-chrome-*.eopkg
@rgbatty
rgbatty / obsidian-wsl-linking.sh
Created March 22, 2022 05:38
Obsidian WSL Linking
#!/bin/bash
echo "Starting Windows configuration"
WIN_USERPATH=$(wslpath $(wslvar USERPROFILE))
WIN_OBSIDIAN=$WIN_USERPATH/Documents/obsidian
WIN_VAULTSDIR=$WIN_OBSIDIAN/vaults
WSL_OBSIDIAN=~/obsidian
if [ ! -d "$WIN_VAULTSDIR" ]; then
@karpathy
karpathy / stablediffusionwalk.py
Last active October 1, 2024 09:56
hacky stablediffusion code for generating videos
"""
stable diffusion dreaming
creates hypnotic moving videos by smoothly walking randomly through the sample space
example way to run this script:
$ python stablediffusionwalk.py --prompt "blueberry spaghetti" --name blueberry
to stitch together the images, e.g.:
$ ffmpeg -r 10 -f image2 -s 512x512 -i blueberry/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p blueberry.mp4