This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to use: sh pwgen.sh <password length, default 9> | |
_LENGTH=9 | |
if test x"$@" != x | |
then _LENGTH="$@" | |
fi | |
cat /dev/urandom |\ | |
tr -dc 'A-Za-z0-9' |\ | |
fold -w $_LENGTH |\ | |
#-w 20 |\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Class | |
bar: -> console.log @a | |
class SubClass extends Class | |
inst = new SubClass | |
inst.a = 10 | |
inst.bar() # => 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body.hold-transition.skin-green.sidebar-mini | |
.wrapper | |
// Шапка | |
header.main-header | |
// Логотип | |
a.logo(href='#') | |
span.logo-mini | |
b Н | |
| К | |
span.logo-lg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <iterator> | |
int main(void) { | |
std::ios::sync_with_stdio(false); | |
int len; | |
std::cin >> len; | |
std::vector<int> vec(201); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
int main(void) { | |
int len; | |
scanf("%d", &len); | |
/* malloc array of ints */ | |
int* arr = (int*)malloc(201 * sizeof(int)); | |
for (int t, i = 0; i < len; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function someHander(req, res, next) { | |
db.any('select * from users') | |
.then((data, cb) => { | |
let red = [] | |
data.forEach(row => { | |
red[i] = row.username | |
}) | |
res.json({ | |
red | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const preset = buildPreset() | |
Object.defineProperty(preset, "buildPreset", { | |
configurable: true, | |
writable: true, | |
enumerable: false, | |
value: buildPreset | |
}) | |
module.exports = preset | |
function buildPreset(opts = {}) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require("http"); | |
var msgs = []; // All messages array | |
var subscribers = []; // All subscribers array | |
var PORT = process.env.PORT || 8080; | |
// Create HTTP server | |
var server = http.createServer(function(req, res) { | |
// Small router | |
switch(req.url) { | |
case "/": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var atBottom = true | |
var scrollTopInitial = -1 | |
$(scrollableWrap).on('scroll', function (e) { | |
if (!element.is(':visible') || | |
$(scrollableWrap).hasClass('im_history_to_bottom') || | |
curAnimation) { | |
return | |
} | |
var st = scrollableWrap.scrollTop | |
atBottom = st >= scrollableWrap.scrollHeight - scrollableWrap.clientHeight |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
class Memoization extends React.Component { | |
lastInput = null; | |
result = null; | |
render() { | |
const { equals, input, compute, children } = this.props; | |
OlderNewer