Skip to content

Instantly share code, notes, and snippets.

View erikzrekz's full-sized avatar
🤹
Working

Eriks Reks erikzrekz

🤹
Working
View GitHub Profile
@erikzrekz
erikzrekz / gist:d1222b9e086b916956e9392dca1c37d0
Last active February 22, 2019 22:52
test-cloudflare-page.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<style>
@font-face {
font-family: "proxima-regular";
font-style: normal;
font-weight: normal;
@erikzrekz
erikzrekz / websockets.js
Created July 26, 2018 21:09
Polo Websockets
/*
To run:
- npm install ws && npm install autobahn
- node websocket {ws, wss} {v1, v2} {if v2 --> channels}
*/
var protocol = process.argv[2];
var api = process.argv[3];
@erikzrekz
erikzrekz / command.sh
Last active December 27, 2017 13:12
Fresh Mac Commands
defaults write com.apple.screencapture location /Users/...
killall SystemUIServer
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
# Log out and log back in to see ^ take effect
@erikzrekz
erikzrekz / hotpo.js
Last active June 5, 2017 01:28
An algorithm that gives you the number of steps it takes n to be 1 — the 3x+1 problem.
var x = 0;
var n = 1988;
do {
if (n % 2 == 0) {
n = n / 2;
} else {
n = (3 * n) + 1;
}
@erikzrekz
erikzrekz / googleSearchUrl.js
Created May 30, 2017 03:40 — forked from dannyid/googleSearchUrl.js
What do these parameters even mean?
const language = `en`,
numResults = `100`, // 1 to 100
personalization = `0`, // Non-personalized
encoding = `UTF-8`,
verbatim = `li:1`, // No auto-correct and no location
ssl = `ssl`;
const googleSearchUrl = `https://www.google.com/search` +
`?q=${keyword}` +
`&hl=${language}` +
@erikzrekz
erikzrekz / col-4-pull-right-img
Created November 17, 2016 23:32
Pulled Right Image Example
<img class="col-md-4 pull-right" src="http://emojipedia-us.s3.amazonaws.com/cache/41/af/41aff1557db7c43d38d4d9f33f59be5f.png" />
@erikzrekz
erikzrekz / col-3-iphone6plus_silver.html
Created November 17, 2016 23:12
marvel-device iphone6plus side-by-side snippet
<p class="col-lg-3 col-md-3 col-sm-3">
<div class="marvel-device iphone6plus silver">
<div class="top-bar"> </div>
<div class="sleep"> </div>
<div class="volume"> </div>
<div class="camera"> </div>
<div class="sensor"> </div>
<div class="speaker"> </div>
<div class="screen">
<!-- <img src=""> goes here -->
@erikzrekz
erikzrekz / iphone6plus_silver.html
Created November 17, 2016 22:49
marvel-device iphone6plus snippet
<div class="marvel-device iphone6plus silver">
<div class="top-bar"></div>
<div class="sleep"></div>
<div class="volume"></div>
<div class="camera"></div>
<div class="sensor"></div>
<div class="speaker"></div>
<div class="screen">
<!-- <img src=""> goes here -->
</div>
app.factory('PollingService', function($http, $timeout) {
var data = { response: {} };
var poller = function() {
$http.get('data.json').then(function(r) {
data.response = r.data;
$timeout(poller, 1000);
});
};
poller();
///////////////////////////////////////////////////
// Source: http://marcel.turi.co/up/favicon.html //
///////////////////////////////////////////////////
var favIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABrUlEQVR42mNkwAOepOgxMTD9mwhk...";
var docHead = document.getElementsByTagName('head')[0];
var newLink = document.createElement('link');
newLink.rel = 'shortcut icon';
newLink.href = favIcon;