Skip to content

Instantly share code, notes, and snippets.

View danakt's full-sized avatar
😉

Danakt Saushkin danakt

😉
View GitHub Profile
@MichaelCurrin
MichaelCurrin / README.md
Last active April 21, 2024 03:12
Deploy to GitHub Pages with GitHub Actions

GH Pages deploy

Deploys for static sites or web apps made easy with GitHub Actions

A generic but elegant CI flow for deploying a site to Github Pages - this is triggered on a push to master and runs on Github Actions - docs.

This workflow is targeted at a static site like Hexo or a single-page applciation like React project. It doesn't matter what the language is as long as your build steps results in a public directory which can be served on Github Pages.

Show me the workflow

Fastpack - pack JavaScript fast & easy

This gist is a submission for a lightning talk on the ReactiveConf 2018.

Why?

  • JavaScript bundling can be a lot faster
  • There are proper tools to guarantee consistency
  • Writing OCaml code is fun!
@electrovladyslav
electrovladyslav / emoji-code-09.js
Last active February 26, 2017 12:14
Emoji-code-09
// ZWJ-последовательность: семья (мужчина, женщина, мальчик)
// U+1F468 + U+200D + U+1F469 + U+200D + U+1F466
[...'👨‍👩‍👦'] // ["👨", "‍", "👩", "‍", "👦"]
‘👨‍👩‍👦’.length // 8
// нейтральная семья
// U+1F46A
[...’👪’] // [’👪’]
’👪’.length // 2
@sagivo
sagivo / gist:3a4b2f2c7ac6e1b5267c2f1f59ac6c6b
Last active April 22, 2024 21:03
webRTC stun / turn server list
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
@manjeshpv
manjeshpv / passport.js
Last active February 29, 2024 15:11
Passport.js using MySQL for Authentication with Express
// config/passport.js
// load all the things we need
var LocalStrategy = require('passport-local').Strategy;
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
@balupton
balupton / cors.js
Created September 11, 2012 05:21
Acheiving CORS via a Node HTTP Server
// Create our server
var server;
server = http.createServer(function(req,res){
// Set CORS headers
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Request-Method', '*');
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET');
res.setHeader('Access-Control-Allow-Headers', '*');
if ( req.method === 'OPTIONS' ) {
res.writeHead(200);
@itorres
itorres / ssha.js
Created June 18, 2012 06:10
node.js ssha hash generation and check functions intended for use with LDAP servers.
var crypto = require('crypto');
/*
* node.js ssha hash generation and check functions intended for use with LDAP servers.
*/
function ssha(cleartext, salt) {
var sum = crypto.createHash('sha1');
( typeof(salt) == 'undefined') ? salt = new Buffer(crypto.randomBytes(20)).toString('base64') : salt = salt;
sum.update(cleartext);
@geddski
geddski / cf.less
Created April 18, 2012 20:06
micro clearfix LESS mixin
/* Micro ClearFix Mixin */
.clearfix{
zoom:1;
&:before, &:after{ content:""; display:table; }
&:after{ clear: both; }
}