Skip to content

Instantly share code, notes, and snippets.

View jpalala's full-sized avatar
🎯
Focusing

Joe Palala jpalala

🎯
Focusing
View GitHub Profile
From: Ian Lance Taylor
After many discussions and reading many comments, we plan to move
forward with some changes and clarifications to the generics design
draft.
1.
We’re going to settle on square brackets for the generics syntax.
We’re going to drop the “type” keyword before type parameters, as
@quinnjr
quinnjr / README.md
Last active March 31, 2024 17:30
How to easily add environment variables to an Angular application

How to easily add environment variables to an Angular application

This guide assumes that you already have an angular application set up by ng create and are using Angular CLI for compilation.

Other guides that I've read rely upon re-writing your environments/environment.ts|environment.prod.ts files with each compilation. I find this to be completely unnecessary when angular's internal use of webpack can just be extended to include environment variables.

1. Add @angular-builders/custom-webpack to your dev-dependencies

@simonerni
simonerni / csrf-protection-cloudflare-worker.js
Created July 7, 2018 14:52
Protect any origin from CSRF by checking if the Origin/Referer header match the Host header for "unsafe" methods.
/**
* GET and HEAD requests are by definition idempotent and should be handled by the origin as such. Thus, we can safely pass them on without further origin / referer checks.
*/
const safeMethods = ['GET','HEAD'];
const allowedMethods = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE'];
addEventListener('fetch', event => {
event.respondWith(verifyAndFetch(event.request))
})
@smks
smks / mason.js
Last active June 10, 2020 18:30
This is a sample commander CLI application used in Medium Article - How I automated my Job with Node JS
#! /usr/bin/env node
const mason = require('commander');
const { version } = require('./package.json');
const console = require('console');
// commands
const create = require('./commands/create');
const setup = require('./commands/setup');
FROM node
RUN mkdir -p /usr/src/app
COPY index.js /usr/src/app
EXPOSE 8080
CMD [ "node", "/usr/src/app/index" ]
This file has been truncated, but you can view the full file.
https://github.com/HandBrake/HandBrake.git
https://github.com/hashcat/hashcat.git
https://github.com/redis/hiredis.git
https://github.com/SamyPesse/How-to-Make-a-Computer-Operating-System.git
https://github.com/hishamhm/htop.git
https://github.com/nodejs/http-parser.git
https://github.com/mruby/mruby.git
https://github.com/nanomsg/nanomsg.git
https://github.com/firehol/netdata.git
https://github.com/arut/nginx-rtmp-module.git
anonymous
anonymous / index.html
Created December 13, 2017 15:18
Justified container into center like in twitter
<div id="app">
<v-toolbar class="green">
<v-toolbar-title>Example vuetify template</v-toolbar-title>
</v-toolbar>
<v-app>
<v-content>
<v-container fluid grid-list-xl>
<v-layout row justify-center>
#!/bin/bash
#
# [Quick LEMP Stack Installation Script]
#
# GitLab: https://gitlab.com/devops212/lempqc
# Modief by wiros4bleng
#
bold=$(tput bold)
normal=$(tput sgr0)
cat <<!
@ibraheem4
ibraheem4 / postgres-brew.md
Last active July 18, 2024 00:18 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update