Skip to content

Instantly share code, notes, and snippets.

View yazz's full-sized avatar

Zubair Quraishi yazz

View GitHub Profile
@davidkathoh
davidkathoh / switch.js
Last active August 15, 2022 12:47
Swicthing and adding network programatically on metamask
async function switchN(){
const provider = window.ethereum;
const binanceTestChainId = '0x61';
if(!provider){
console.log("Metamask is not installed, please install!");
}else{
@trevorbox
trevorbox / envoyfilter-custom-header-span-x-forwarded-user.yaml
Created March 9, 2021 22:15
Istio EnvoyFilter custom header tag example for adding additional metadata to the span. See https://github.com/istio/istio/issues/22457.
---
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: custom-header-span-x-forwarded-user
namespace: istio-system
spec:
configPatches:
- applyTo: NETWORK_FILTER
match:
@stevepeak
stevepeak / 1.md
Last active January 3, 2020 17:54

counter-tweet

With Storyscript, we got it done in under 4 minutes and 4 lines of code.

(Updated) Sad the the tweet was deleted...because some of the answers were half a days work using terminal, git and containers.

Introduction
============
Industry statistics as a whole have failed to improve much since 1968, when software engineering and
scientific management were introduced as means for resolving the "software crisis". Unfortunately
abandoned projects, cost/time overruns, and bloated, buggy software still dominate the landscape.
In spite of the efforts to mitigate this situation --like XP, agile, software craftsmanship or DDD-- the
reality is that a usual software project stack involves an increasingly larger number of programming
languages, DSLs, frameworks, systems, tools, techniques and processes, so it is a fact that the
@keisisqrl
keisisqrl / uuidgen.sql
Last active December 31, 2023 07:34
uuidgen for sqlite
/* uuidgen.sql
*
* creates a view uuidgen(uuid TEXT) which generates v4 UUIDs on demand
* generated per RFC 4122
*
* it's not a stored procedure exactly but subqueries are allowed in
* any expression
**/
CREATE VIEW uuidgen AS
SELECT printf('%x-%x-%x-%x-%x',

Snake Game

Special thanks to Simon Craggs @ soundbible.com for crunch.mp3 http://soundbible.com/1968-Apple-Bite.html, and Mike Koenig @ soundbible.com for beep.mp3 http://soundbible.com/1251-Beep.html.

We'll use a #system/timer to advance the game one frame each tick. The #movement records contain some housekeeping information about the ways a snake can move, and what precisely those movements mean. The #pixel-scale record can be adjusted in the future by a (not yet added) resize event to resample the board appropriately.

commit
  [#system/timer #time resolution: 1000 / 6] // Tick the game 6 times a second.

[#movement direction: "left" dx: -1 dy: 0 | opposite: "right"]

@mjhanninen
mjhanninen / fixes-to-sanjeevs-vuejs-tutorial.md
Created December 30, 2016 08:58
Fixes to A. Sanjeevs' Vue.js tutorial

Fixes to A. Sanjeevs' Vue.js tutorial

If you work through [Anirudh Sanjeevs'][sanjeev] excellent tutorial on setting up a [Vue.js][vuejs] project with [Webpack][webpack] and some other goodies, you'll probably hit a handful of minor problems. The tutorial was written a year ago and things have changed a lot since then which naturally explains the issues. So let's tackle them one by one.

The first problem is that Vue.js fails to mount the app component and raises the following error:

@dcode
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active May 24, 2024 07:51
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)

anonymous
anonymous / rock-paper-scissor.eve
Created September 12, 2016 11:27
Rock-Paper-Scissor in EVE
# Rock Scissor Paper
Based on https://rosettacode.org/wiki/Rock-paper-scissors
Rules are simple:
The winner is decided by a set of rules:
* Rock beats scissors
* Scissors beat paper
* Paper beats rock
@maximilian-lindsey
maximilian-lindsey / express_in_electron.md
Last active March 29, 2024 22:46
How to run Express inside an Electron app

How to run Express inside an Electron app

You can run your Express app very easily inside your Electron app.

All you need to do is to:

  • place all the files of your Express app inside a new app folder in your_electron_app\resources\app
  • reconfigure the app.js file
  • refactor some relative pathes in your Express app